Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why wont the SelectionBox script work?

Asked by
Rurith 10
10 years ago
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!

0
Is this the full script? Any output? TheLuaWeaver 301 — 10y
0
Nope Rurith 10 — 10y

1 answer

Log in to vote
0
Answered by
M39a9am3R 3210 Moderation Voter Community Moderator
10 years ago
--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()
Ad

Answer this question