generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Why is this spectate script not working...

Previous Thread :: Next Thread 
DesiredROBLOXlAN is not online. DesiredROBLOXlAN
Joined: 01 Mar 2012
Total Posts: 971
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
DesiredROBLOXlAN is not online. DesiredROBLOXlAN
Joined: 01 Mar 2012
Total Posts: 971
27 Dec 2016 08:55 PM
b


~The most desired of Robloxians
Report Abuse
DesiredROBLOXlAN is not online. DesiredROBLOXlAN
Joined: 01 Mar 2012
Total Posts: 971
27 Dec 2016 09:04 PM
b...


~The most desired of Robloxians
Report Abuse
DesiredROBLOXlAN is not online. DesiredROBLOXlAN
Joined: 01 Mar 2012
Total Posts: 971
27 Dec 2016 09:16 PM
Can nobody help?


~The most desired of Robloxians
Report Abuse
DesiredROBLOXlAN is not online. DesiredROBLOXlAN
Joined: 01 Mar 2012
Total Posts: 971
27 Dec 2016 09:35 PM
b...


~The most desired of Robloxians
Report Abuse
DesiredROBLOXlAN is not online. DesiredROBLOXlAN
Joined: 01 Mar 2012
Total Posts: 971
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image