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

Script using Player Added Isn't working on Studio?

I made a script that uses PlayerAdded() but when I test it in studio it doesn't work but when I test it on the website it works perfectly. I looked at the output and nothing comes out. Am I doing something wrong?

wait(0.1)
local Radius = script.Parent
local CharacterPoint = nil

game.Players.PlayerAdded:connect(function(player)
	wait(5)
local Character = player.Character
CharacterPoint = Character:FindFirstChild("Head")

end)

PS: I'm using FE if that helps.

1 answer

✓ Accepted answer

You should use CharacterAdded and WaitForChild:

local CharacterPoint
game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(Character)
		CharacterPoint = Character:WaitForChild("Head")
	end)
end)

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