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

Script doesn't work when another player enters the game? [SOLVED!]

Asked by
Jurdy 0
10 years ago

game.Players.PlayerAdded:connect(function(p) wait(1) p.CameraMaxZoomDistance = 10 p.CameraMinZoomDistance = 10 p.NameDisplayDistance = 0 end)

-- when i join alone everything is fine, but when someone else joins it disables the whole script :(

please help!

0
Please use a Lua code block NotsoPenguin 705 — 10y
0
i found out that i should use "for i, v in ipairs ( game.Players:GetChildren()) do" in order for it to work...SOLVED! :DDD Jurdy 0 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago

Please put your code in lua. If you do not know how to, simply click the blue bubble and add your code in the lines.

Ad
Log in to vote
0
Answered by 10 years ago

Hmmmm... Try using this:

game.Players.PlayerAdded:connect(function(p) 
wait(1) 
for i,v in ipairs(game.Players:GetChildren()) do
v.CameraMaxZoomDistance = 10 
v.CameraMinZoomDistance = 10 
v.NameDisplayDistance = 0 
end
end)

If this doesn't work then i'm sorry.

Answer this question