hopperkk
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 4444 |
|
| |
|
MXrcr20
|
  |
| Joined: 01 Oct 2008 |
| Total Posts: 2644 |
|
| |
|
hopperkk
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 4444 |
|
| |
|
hopperkk
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 4444 |
|
| |
|
hopperkk
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 4444 |
|
| |
|
hopperkk
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 4444 |
|
| |
|
MXrcr20
|
  |
| Joined: 01 Oct 2008 |
| Total Posts: 2644 |
|
|
| 11 Aug 2011 10:36 AM |
| There isn't a connection line for function leaderstats(newPlayer) |
|
|
| Report Abuse |
|
|
hopperkk
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 4444 |
|
| |
|
MXrcr20
|
  |
| Joined: 01 Oct 2008 |
| Total Posts: 2644 |
|
|
| 11 Aug 2011 10:43 AM |
| I have a script that I made for my minigames. I can give that to you when I get home. I can't download roblox on the computer I'm on right now. |
|
|
| Report Abuse |
|
|
hopperkk
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 4444 |
|
| |
|
hopperkk
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 4444 |
|
| |
|
|
| 11 Aug 2011 10:58 AM |
I made a few changes to the script. I also added a debugging system of prints in case it doesn't work still. If it doesn't work the give me the output, if it does, remove all the prints.
d = true
function onClicked() if not d then return end d = false print'1' function leaderstats(newPlayer) print'2' local humanoid = game.Workspace.Player.Humanoid print'3' local Points = game.Workspace.Board.newPlayer.leaderstats.points print'4' if Points.Value >= 50 then print'5' Points.Value = Points.Value - 50 print'6' game.Workspace.Player.Humanoid.WalkSpeed = game.Workspace.Player.Humanoid.WalkSpeed + 25 print'7' end d = true end
script.Parent.MouseButton1Click:connect(onClicked) |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2011 11:06 AM |
Wait, make your script a localscript and put this in it, :)
d = true
script.Parent.MouseButton1Click:connect(function() if not d then return end d = false local Kid = game.Players.LocalPlayer local humanoid = Kid.Character.Humanoid local Points = Kid.leaderstats.Points if Points.Value >= 50 then Points.Value = Points.Value - 50 Kid.Character.Humanoid.WalkSpeed = Kid.Character.Humanoid.WalkSpeed + 25 end d = true end)
|
|
|
| Report Abuse |
|
|
hopperkk
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 4444 |
|
| |
|
hopperkk
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 4444 |
|
| |
|
|
| 11 Aug 2011 11:27 AM |
What? Remove you old script, and High-Light your Gui TextButton.
Go to Insert>Object>LocalScript.
Paste the script I made for you in to it. |
|
|
| Report Abuse |
|
|
hopperkk
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 4444 |
|
| |
|
hopperkk
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 4444 |
|
| |
|
|
| 11 Aug 2011 11:36 AM |
Is this a gui that I am working with? If so then make sure you're using a localscript.
There is nothing wrong with my script. |
|
|
| Report Abuse |
|
|
hopperkk
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 4444 |
|
| |
|
|
| 11 Aug 2011 11:38 AM |
Ah good, leaderstats must NOT have an upper-case L.
Leaderstats <- Wrong
leaderstats <- Right
function leaderstats(newPlayer)
leader = Instance.new("IntValue", newPlayer) leader.Name = "leaderstats"
points = Instance.new("IntValue", leader) points.Value = 0 points.Name = "Points"
while true do newPlayer.leaderstats.points.Value = newPlayer.leaderstats.points.Value + 10 wait(7)
end end
game.Players.PlayerAdded:connect(leaderstats) |
|
|
| Report Abuse |
|
|
hopperkk
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 4444 |
|
| |
|
hopperkk
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 4444 |
|
| |
|
hopperkk
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 4444 |
|
| |
|
|
| 11 Aug 2011 12:08 PM |
| I can't, you may have set the name of Points to 'points'. |
|
|
| Report Abuse |
|
|