跳转到内容

胜利特写

胜利特写

--当角色进入信号触发盒
System:RegisterEvent(
Events.ON_CHARACTER_ENTER_SIGNAL_BOX,
function (playerId, signalBoxId) --playerId = 玩家id, signalBoxId = 信号触发盒id
if signalBoxId == 227 then--如果是指定信号触发盒
Character:SetAttributeEnabled(playerId, Character.ATTR_ENABLE.CanMove, false)--关闭角色移动属性权限
Animation:PlayAnim(Animation.PLAYER_TYPE.Character, playerId, "Donggan", Animation.PART_NAME.FullBody)--让角色播放动画
Particle:PlayOnCharacter(68, playerId, Character.SOCKET_NAME.Root, true, 10)--在角色身上创建特效
local time = 3
--每隔1秒执行一次
TimerManager:AddLoopTimer(
1.0,
function()
time = time - 1
if time == 0 then
Character:SetPlayerVictory(Character:GetLocalPlayerId())--3秒后让玩家胜利(仅竞速生效)
end
end
)
end
end
)