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

How to make the points permanent?

Asked by 8 years ago

I have a point giving script and what would be the correct script to add to this so that when a player leaves and rejoins, the points that are given from this part are still there. Currently, when you leave, you will lose all of the points that you got from this part. How would I make the points not go away?

01local ting = 0
02 
03function onTouched(hit)
04 
05    if ting == 0 then
06    ting = 1
07    check = hit.Parent:FindFirstChild("Humanoid")
08 
09    if check ~= nil then
10 
11        local user = game.Players:GetPlayerFromCharacter(hit.Parent)
12        local stats = user:findFirstChild("leaderstats")
13 
14        if stats ~= nil then
15            local cash = stats:findFirstChild("Points")
View all 27 lines...

1 answer

Log in to vote
1
Answered by 8 years ago

Use a DataStore, here is the Wiki: http://wiki.roblox.com/index.php?title=Data_store

Hope I helped :)

Ad

Answer this question