|
| 29 Apr 2017 01:58 PM |
Since I quit scripting for a while I can't find a way to get this to work. I've been looking around but nothing seems helpful. Any ways?
|
|
|
| Report Abuse |
|
|
Cyrakohl
|
  |
| Joined: 09 Nov 2014 |
| Total Posts: 3197 |
|
| |
|
|
| 29 Apr 2017 02:03 PM |
Textbutton. I made a working one but only worked in studio :S
|
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 29 Apr 2017 02:04 PM |
This should be in the guibutton object. Put a RemoteEvent in ReplicatedStorage named Money. ---------------------------------------
local plr = game.Players.LocalPlayer; local re = game.ReplicatedStorage.Money; local moneyStatName = "Money"; --Name of your money stat local amount = 100; --amount to give
script.Parent.MouseButton1Down:Connect(function() local stat = plr.leaderstats:FindFirstChild(moneyStatName); if stat then re:FireServer(amount); else print("Money stat not found"); end end)
This should be in serverscriptstorage ------------------------------------
local re = game.ReplicatedStorage.Money;
re.OnServerEvent:Connect(function(c,amount) local stat = c.leaderstats:FindFirstChild(moneyStatName); if stat then stat.Value = stat.Value + amount; end end)
|
|
|
| Report Abuse |
|
|
|
| 29 Apr 2017 02:06 PM |
I'm not using a local script for this. But thanks anyways. I found a fix. Might save it for later if mine breaks. xD
|
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 29 Apr 2017 02:07 PM |
You should be since MouseButton1Click is only used for guis
|
|
|
| Report Abuse |
|
|
| |
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
| |
|
| |
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 29 Apr 2017 06:55 PM |
LocalScripts should be used with Guis.
|
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 29 Apr 2017 06:59 PM |
| Cyber is too stubborn to use local scripts when they should be used. |
|
|
| Report Abuse |
|
|
|
| 29 Apr 2017 07:17 PM |
If it works, there's no need to make it more advanced. No comment.
|
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 29 Apr 2017 07:19 PM |
| Using a server script to change a gui is like using deprecated things(like :Remove() or Keyboard input) while knowing they're deprecated, all it shows is that you're too lazy to do something right. |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 29 Apr 2017 07:47 PM |
OHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
lmfao
burn
need sum ice bruh?
|
|
|
| Report Abuse |
|
|