game.Players.PlayerAdded:Connect(function(player)
game.StarterPlayer.CameraMaxZoomDistance = 0
end)
我希望玩家只有在第一次加入游戏时才能处于第一视角。他们死后他们应该是第三人。我该怎么做?
game.Players.PlayerAdded:Connect(function(player)
game.StarterPlayer.CameraMaxZoomDistance = 0
end)
在第1行之后和游戏之前.StarterPlayer添加了一个characteradded函数
player.CharacterAdded:connect(function(character)
character:WaitForChild("Humanoid").Died:connect(function()
game.StarterPlayer.CameraMaxZoomDistance = (number you want for default)
end)
end)
等待字符重新生成并获取该字符并将其放入字符变量中,然后游戏等待Humanoid对象出现在字符内,然后等待Died事件发生,这是监视事件的事件respawn或“death”然后根据你输入的数字将cameradistance恢复正常。