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 |
|
|
|
| 21 Oct 2013 05:09 AM |
| Add function when a player joins. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| Joined: 30 Apr 2011 |
| Total Posts: 791 |
|
|
| 21 Oct 2013 11:04 PM |
| it has a gui button click function already. |
|
|
| Report Abuse |
|
|
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 |
|
|