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

Why wont the SelectionBox script work?

game.Players.PlayerAdded:connect(function(player)


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

NVG()

Why wont it work, it should create a blue box around your player. But, sadly it wont work!

2 comments

0

Is this the full script? Any output?

0

Nope

1 answer

--game.Players.PlayerAdded:connect(function(player)
--function NVG()
--for _,p in next, game.Players:GetPlayers() do   --Instance.new('SelectionBox',p[i].Character).Adornee=p[i].Character end -- You needed the index --value for the player.
--end
--end)
--NVG()

Wait for in next? Huh?

Scratch everything above;

game.Players.PlayerAdded:connect(function(player)
p = game.Players:GetPlayers()
function NVG()
for i=1, #p do
Instance.new('SelectionBox',p[i].Character).Adornee=p[i].Character end
end
end)
NVG()

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