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

How do I add to leaderstats (leaderboard) when a player kills another player?

Asked by
ElBamino 153
3 years ago

Hey scriptinghelpers I don't really know how else to ask this but, how do I add to leaderstats when a player kills another player? For example if Builderman kills Telamon add +100 to Builderman's leaderstats (leaderboard). I don't know if you need a sample code so I didn't provide one since its a basic leaderboard and, I'm using the "Sword" tool by ROBLOX. Thank you for the help in advance, I appreciate it!

1 answer

Log in to vote
0
Answered by 3 years ago

So if you're using the default roblox leaderboard system then you can just put a folder inside the player and name it "leaderstats", and then whatever values you put in there will be displayed. So say for instance I put an IntValue in that folder and call it "Coins". It'll show "Coins" and underneath it'll show the value for that. In this case it'd be set to 0 since it hasn't been set yet.

0
And since only the server has access to the children of the player, i.e. PlayerScripts, then you could either create a remote event to change the value, or manually change it if it's already in a server script. For stuff like that I actually recommend using a module, but it doesn't really matter which way you go about it. acer1102 97 — 3y
0
I already have a leaderstats script in ServerScriptStorage I made myself. I was wondering how I add to it when a player kills another player. ElBamino 153 — 3y
0
like I said either set the value through a regular script, or execute a remote event if it's in a local script acer1102 97 — 3y
Ad

Answer this question