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 » Scripting Helpers
Home Search
 

script doesnt work with 2+ people

Previous Thread :: Next Thread 
CarlosMX is not online. CarlosMX
Joined: 30 Apr 2011
Total Posts: 791
21 Oct 2013 01:04 AM
I am pretty sure that this part of my script is the part not working. No output errors. But its not passing this point. works fine in solo and play mode with just me, but once somebdy else comes, the buttons dont work.

for _, v in pairs (game:GetService('Players'):GetPlayers()) do
v.PlayerGui.trackvote.Frame.Tracks:findFirstChild(script.Parent.Name).votes.Value = v.PlayerGui.trackvote.Frame.Tracks:findFirstChild(script.Parent.Name).votes.Value +1
end
Report Abuse
Project2015 is not online. Project2015
Joined: 11 Sep 2013
Total Posts: 384
21 Oct 2013 05:09 AM
Add function when a player joins.
Report Abuse
Project2015 is not online. Project2015
Joined: 11 Sep 2013
Total Posts: 384
21 Oct 2013 05:11 AM
function OnAdded(player)
player.PlayerGui.trackvote.Frame.Tracks:findFirstChild(script.Parent.Name).votes.Value = player.PlayerGui.trackvote.Frame.Tracks:findFirstChild(script.Parent.Name).votes.Value +1
end
Report Abuse
Project2015 is not online. Project2015
Joined: 11 Sep 2013
Total Posts: 384
21 Oct 2013 05:11 AM

function OnAdded(player)
player.PlayerGui.trackvote.Frame.Tracks:findFirstChild(script.Parent.Name).votes.Value = player.PlayerGui.trackvote.Frame.Tracks:findFirstChild(script.Parent.Name).votes.Value +1
end

game.Players.PlayerAdded:connect(onAdded)
Report Abuse
CarlosMX is not online. CarlosMX
Joined: 30 Apr 2011
Total Posts: 791
21 Oct 2013 11:04 PM
it has a gui button click function already.
Report Abuse
CarlosMX is not online. CarlosMX
Joined: 30 Apr 2011
Total Posts: 791
21 Oct 2013 11:08 PM
I changed the script a bit, still doesn't work in play mode. Heres the full script:
function onButtonClicked()
game.Debris:findFirstChild(script.Parent.Name).Value = game.Debris:findFirstChild(script.Parent.Name).Value +1
script.Parent.Parent.Visible = false
script.Parent.Parent.Parent.sucess.Visible = true
script.Parent.Parent.Parent.sucess1.Visible = true
for _, v in pairs (game:GetService('Players'):GetPlayers()) do
if game.Debris:findFirstChild(script.Parent.Name).Value >= v.PlayerGui.trackvote.Frame.one.votes.Value then
v.PlayerGui.trackvote.Frame.one.votes.Value = game.Debris:findFirstChild(script.Parent.Name).Value
v.PlayerGui.trackvote.Frame.one.Text = "Top voted: " ..script.Parent.Text.. " " ..v.PlayerGui.trackvote.Frame.one.votes.Value.. " votes"
v.PlayerGui.trackvote.Frame.one.Track.Value = script.Parent.Track.Value

end
end
end

script.Parent.MouseButton1Down:connect(onButtonClicked)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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