What does this mean and how can I fix this? It's a localscript and here's the code:
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Torso = Character.Torso --Error seems to be here
Thanks for helping me out!
What does this mean and how can I fix this? It's a localscript and here's the code:
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Torso = Character.Torso --Error seems to be here
Thanks for helping me out!
You must wait for the character to spawn before you can do anything to it.
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Torso = Character:WaitForChild("Torso") --if R15 use UpperTorso, LowerTorso or HumanoidRootPart instead
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
it means that the player currently has no character. you just need to wait until they have spawned.
Add this after local player part. repeat wait until Player:FindFirstChild("Character")
@iRexBot, Character isn't a child of Player, it's a Property: http://wiki.roblox.com/index.php?title=API:Class/Player/Character