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

How would you make a stat system and level system?

Asked by 6 years ago

I've done this with leaderstats before and its easy that way.

I want to know how to do it without so its harder to exploit/change with exploits.

0
server side exploits are rare to find so i suggest server sided not using the leaderboard in the top right The_Pr0fessor 595 — 6y
0
I will not write the script for you. I was just writing an example. We are scripting helpers. Not script builders. My example was a proof of concept. Just add more Instances and change their purposes to the script and you are good to go. Write it yourself. User#21908 42 — 6y
0
if I helped you out please accept my answer. Otherwise comment how I can help you better. User#21908 42 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

You should keep all the real values somewhere that the client cannot access them. I personally use ServerStorage. Then you can have a Changed event linked to those values and make the leaderboard display them. Here is an example:

game.Players.PlayerAdded:Connect(function(player)

    local stats = Instance.new("Folder")
    stats.Name = "leaderstats"
    stats.Parent = player

    local cash = Instance.new("IntValue")
    cash.Name = "Cash"
    cash.Parent = stats

    local playerFolder = Instance.new("Folder")
    playerFolder.Name = player.Name -- every time you need to access the players real money from a script you will need to find the folder with the players name in ServerStorage
    playerFolder.Parent = ServerStorage

    local serverCash = Instance.new("IntValue")
    serverCash.Name = "ServerCash"
    serverCash.Parent = playerFolder

    serverCash.Changed:Connect(function()
        -- whenever serverCash gets changed by you the leader board will now display that amount without it being vulnerable to attack
        cash.Value = serverCash.Value

    end)
end)

Note: You will have to remember to :Destroy() the folder when the player leaves. else server storage could quickly be filled up with folders. Hope this helps and have a great day scripting!

0
As In Stats I'm referring to Strength, Agility, Defense ZapherosX 43 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

I remember seeing something where you would have another two values and if the real values were different to the other two then it would change back. So basically say when a player earns 1 cash it updates the two different values and then the real values contain a script were if it notices a change it will update the real values.

Hope this helps.

Answer this question