Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Whats wrong with local script?

ps local script

local player = game.Players.LocalPlayer

If player.Character:FindFirstChild("Head") then
print("found")
end

Error says no character

1 answer

✓ Accepted answer

Ok, you indexed the variable player to game.Players.LocalPlayer before the LocalPlayer even existed. To prevent from doing that, you should have

repeat wait() until game:GetService'Players'.LocalPlayer and game:GetService'Players'.LocalPlayer.Character

then you can index a variable for them

and you also have a capital I in your if statement, it should be lowercase

repeat wait() until game:GetService'Players'.LocalPlayer and game:GetService'Players'.LocalPlayer.Character
local player = game.Players.LocalPlayer
local character = player.Character

If character:FindFirstChild("Head") then
print("found")
end



This discussion is preserved as it was. New answers, comments, and votes are closed.