[英]Attempt to index nil with humanoid
我尝试对加入游戏的玩家应用人形描述,但 output 给出错误:“尝试使用人形索引 nil”。 这是代码。
game.Players.PlayerAdded:Connect(function(Player)
Player.Character.Humanoid:ApplyDescription(game.ServerStorage.HumanoidDescription)
end)
您应该等待角色加载到游戏中。 在应用 HumanoidDescription 之前。
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(character)
wait()
character:WaitForChild("Humanoid"):ApplyDescription(game.ServerStorage.HumanoidDescription)
end)
end)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.