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

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

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!

2 comments

0

Please use a Lua code block

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

2 answers

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.

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.

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