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
 

[ Content Deleted ]

Previous Thread :: Next Thread 
hopperkk is online. hopperkk
Joined: 18 Oct 2009
Total Posts: 4444
11 Aug 2011 10:23 AM
[ Content Deleted ]
Report Abuse
MXrcr20 is not online. MXrcr20
Joined: 01 Oct 2008
Total Posts: 2644
11 Aug 2011 10:24 AM
Output?
Report Abuse
hopperkk is online. hopperkk
Joined: 18 Oct 2009
Total Posts: 4444
11 Aug 2011 10:25 AM
[ Content Deleted ]
Report Abuse
hopperkk is online. hopperkk
Joined: 18 Oct 2009
Total Posts: 4444
11 Aug 2011 10:26 AM
[ Content Deleted ]
Report Abuse
hopperkk is online. hopperkk
Joined: 18 Oct 2009
Total Posts: 4444
11 Aug 2011 10:30 AM
[ Content Deleted ]
Report Abuse
hopperkk is online. hopperkk
Joined: 18 Oct 2009
Total Posts: 4444
11 Aug 2011 10:31 AM
[ Content Deleted ]
Report Abuse
MXrcr20 is not online. 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 is online. hopperkk
Joined: 18 Oct 2009
Total Posts: 4444
11 Aug 2011 10:40 AM
[ Content Deleted ]
Report Abuse
MXrcr20 is not online. 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 is online. hopperkk
Joined: 18 Oct 2009
Total Posts: 4444
11 Aug 2011 10:45 AM
[ Content Deleted ]
Report Abuse
hopperkk is online. hopperkk
Joined: 18 Oct 2009
Total Posts: 4444
11 Aug 2011 10:53 AM
[ Content Deleted ]
Report Abuse
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
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
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
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 is online. hopperkk
Joined: 18 Oct 2009
Total Posts: 4444
11 Aug 2011 11:13 AM
[ Content Deleted ]
Report Abuse
hopperkk is online. hopperkk
Joined: 18 Oct 2009
Total Posts: 4444
11 Aug 2011 11:21 AM
[ Content Deleted ]
Report Abuse
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
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 is online. hopperkk
Joined: 18 Oct 2009
Total Posts: 4444
11 Aug 2011 11:29 AM
[ Content Deleted ]
Report Abuse
hopperkk is online. hopperkk
Joined: 18 Oct 2009
Total Posts: 4444
11 Aug 2011 11:34 AM
[ Content Deleted ]
Report Abuse
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
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 is online. hopperkk
Joined: 18 Oct 2009
Total Posts: 4444
11 Aug 2011 11:36 AM
[ Content Deleted ]
Report Abuse
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
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 is online. hopperkk
Joined: 18 Oct 2009
Total Posts: 4444
11 Aug 2011 11:42 AM
[ Content Deleted ]
Report Abuse
hopperkk is online. hopperkk
Joined: 18 Oct 2009
Total Posts: 4444
11 Aug 2011 11:47 AM
[ Content Deleted ]
Report Abuse
hopperkk is online. hopperkk
Joined: 18 Oct 2009
Total Posts: 4444
11 Aug 2011 12:04 PM
[ Content Deleted ]
Report Abuse
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
11 Aug 2011 12:08 PM
I can't, you may have set the name of Points to 'points'.
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