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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|