|
| 27 Dec 2016 08:42 PM |
So I just started coding a spectate GUI and for some reason it won't cycle through all the players on the team, it just stops at the first player.. anyone know why?
here's the code!
wait(0.05)
reload = false PNum = 1 num = 0
script.Parent.Next.MouseButton1Click:connect(function() if reload == false then reload = true if num == 8 then num = 0 else num = num + 1 end print(num) for i, v in pairs(game.Teams.Runners:GetPlayers()) do if PNum == num then workspace.CurrentCamera.CameraSubject = v.Character.Humanoid else PNum = PNum + 1 print(PNum) end end reload = false end end)
~The most desired of Robloxians |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2016 08:55 PM |
b
~The most desired of Robloxians |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2016 09:04 PM |
b...
~The most desired of Robloxians |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2016 09:16 PM |
Can nobody help?
~The most desired of Robloxians |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2016 09:35 PM |
b...
~The most desired of Robloxians |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2016 11:24 PM |
I have Refined the code, but it still won't work... can ANYONE help?
wait(0.05)
reload = false PNum = 1 num = 0 LastP = ""
script.Parent.Next.MouseButton1Click:connect(function() if reload == false then reload = true if num == game.Players.NumPlayers then num = 1 else num = num + 1 end print(num) PNum = 1 for i, v in pairs(game.Teams.Runners:GetPlayers()) do if PNum == num then LastP = v.Name print(PNum) workspace.CurrentCamera.CameraSubject = v.Character.LowerTorso else PNum = PNum + 1 end end reload = false end end)
~The most desired of Robloxians |
|
|
| Report Abuse |
|
|