Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

after function how would you add +1 leaderstats to the player?

Asked by
OFF_S4LE 127
4 years ago
Edited 4 years ago

Like you want to give a player a leader stat everytime they click a part/gui

1mousebutton1down(function()
2--[giving the player 1 leader stats when they click]

I'm not good with stuff like this so help would be appreciated :D

0
this website is for scripting help, NOT for script requests. there are plenty of tutorials on leaderstats zadobyte 692 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago
01-- In a local script in the gui
02 
03game.ReplicatedStorage.GiveMoney:FireServer() -- Change "GiveMoney" to the name of your event in ReplicatedStorage
04 
05--[ I am also guessing you have leaderstats.
06 
07In a server script in ServerScriptService --]
08 
09game.ReplicatedStorage.GiveMoney.OnServerEvent:Connect(function(player)
10player.leaderstats.cash.value = player.leaderstats.value + 100 -- Change cash to your leaderstat and 100 to what amount you want.
11end)

Using events btw.

0
This may not be the way you want it, idk. EH2019SIT 78 — 4y
Ad

Answer this question