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

How to make this script LocalPlayer?

I am trying to do this:

I want this script to ONLY run if you are wearing the hat, but the SCRIPT only runs for you WHEN YOU are WEARING the hat.

function nvg(p)
	p.CharacterAdded:connect(function(c)
		Instance.new('SelectionBox',p.Character).Adornee=c
	end)
end

for _,p in next, game.Players:GetPlayers() do
	Instance.new('SelectionBox',p.Character).Adornee=c
	nvg(p)
end
game.Players.PlayerAdded:connect(function(p)   
	nvg(p)
end)

1 answer

You'll probably need a loop so it always checks if the player has the hat.

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