23144567
|
  |
| Joined: 16 Jul 2014 |
| Total Posts: 533 |
|
|
| 14 Jul 2017 11:38 PM |
I know you probably wont help, but I need a script that goes in a Part with a ClickDetector in the Part and the script will make it so when you click on the Part it removes $50 from the leaderStats and gives you a tool. So like a shop that when you click on the part you buy a tool.
Thanks so much if you do it, I really need it for a game I am working on, I can't really script but I can build, Thanks! |
|
|
| Report Abuse |
|
|
snowparks
|
  |
| Joined: 10 Apr 2017 |
| Total Posts: 64 |
|
|
| 14 Jul 2017 11:41 PM |
script.Parent.ClickDetector.MouseClick:connect(function(player) player.leaderstats.Money.Value = player.leaderstats.Money.Value - 50 game.ServerStorage.Tool:Clone().Parent = player.BackPack end)
|
|
|
| Report Abuse |
|
|
Ewarr1011
|
  |
| Joined: 12 Apr 2013 |
| Total Posts: 203 |
|
|
| 14 Jul 2017 11:42 PM |
^ Damn you're fast, I was going to help xD
MEMESSSSS |
|
|
| Report Abuse |
|
|
snowparks
|
  |
| Joined: 10 Apr 2017 |
| Total Posts: 64 |
|
|
| 14 Jul 2017 11:44 PM |
u can improve it by adding a check if the user has enough money
since i was too lazy and tired to remember to do that
|
|
|
| Report Abuse |
|
|
23144567
|
  |
| Joined: 16 Jul 2014 |
| Total Posts: 533 |
|
|
| 14 Jul 2017 11:47 PM |
Thanks, but can you make it so it checks if the user has enough money please?
Thanks |
|
|
| Report Abuse |
|
|
EataPig98
|
  |
| Joined: 01 Mar 2014 |
| Total Posts: 173 |
|
|
| 14 Jul 2017 11:54 PM |
script.Parent.ClickDetector.MouseClick:connect(function(player) if player.leaderstats.Money.Value > 49 then player.leaderstats.Money.Value = player.leaderstats.Money.Value - 50 game.ServerStorage.Tool:Clone().Parent = player.BackPack else print "not enough money!" end end)
screw roblox updates |
|
|
| Report Abuse |
|
|
23144567
|
  |
| Joined: 16 Jul 2014 |
| Total Posts: 533 |
|
| |
|
23144567
|
  |
| Joined: 16 Jul 2014 |
| Total Posts: 533 |
|
|
| 15 Jul 2017 12:17 AM |
Wow, its not putting the tool in my backpack :( I named it right and put the tool in ServerStorage |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2017 12:22 AM |
| Could you relay anything the output says? I did notice that "BackPack" should be lowercased to "Backpack". |
|
|
| Report Abuse |
|
|
23144567
|
  |
| Joined: 16 Jul 2014 |
| Total Posts: 533 |
|
|
| 15 Jul 2017 12:31 AM |
Okay thanks that was the problem ^
Thanks for your help guys, it works now. |
|
|
| Report Abuse |
|
|