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
 

Re: I've finally brought you an actual scripting problem,

Previous Thread :: Next Thread 
theKingBH is not online. theKingBH
Joined: 25 Jul 2014
Total Posts: 1832
31 Jul 2014 09:45 PM
As I'm new to scripting I have LITERALLY no idea what to do here. So I got this script off a fellow forumer in Building Helpers to change your walkspeed when touched.

The point on this thread is that it's for my minigames, meaning it's an upgrade at a shop in the game. So say I have 200 points and this upgrade takes 200 points to buy, how do I configure this script to remove 200 points from the user stepping on the brick.

script.Parent.Touched.connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Walkspeed = 25

Thank you.

-Your least favourite forumer.
Report Abuse
ROBLOXTHEMOVIEs is not online. ROBLOXTHEMOVIEs
Joined: 11 Jun 2012
Total Posts: 5895
31 Jul 2014 09:50 PM
script.Parent.Touched.connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Walkspeed = 25
end
end)
Report Abuse
theKingBH is not online. theKingBH
Joined: 25 Jul 2014
Total Posts: 1832
31 Jul 2014 09:51 PM
@ROBLOX, why does that have:

end
end) on it?

-Your least favourite forumer.
Report Abuse
Ludav is not online. Ludav
Joined: 28 Jul 2014
Total Posts: 112
31 Jul 2014 09:59 PM
The first 'end' ends the 'if statement', the second 'end)' ends the function.
Note:
the function starts with a parenthesis, so it MUST end with one.

But I really wouldn't know.
Report Abuse
theKingBH is not online. theKingBH
Joined: 25 Jul 2014
Total Posts: 1832
31 Jul 2014 10:03 PM
@ROBLOX, there seems to be nothing in the script you fixed that takes away 200 points mate...

And thanks for that, Ludav. Now I understand all the 'ends'.

-Your least favourite forumer.
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