Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make the points permanent?

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?

local ting = 0

function onTouched(hit)

	if ting == 0 then 
	ting = 1
	check = hit.Parent:FindFirstChild("Humanoid")

	if check ~= nil then 

		local user = game.Players:GetPlayerFromCharacter(hit.Parent)
		local stats = user:findFirstChild("leaderstats")

		if stats ~= nil then 
			local cash = stats:findFirstChild("Points")
			cash.Value  = cash.Value  +5 
		wait(0.1) 
		end 

	end 

	ting = 0
	end 

end 

script.Parent.Touched:connect(onTouched)

1 answer

✓ Accepted answer

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

Hope I helped :)

This discussion is preserved as it was. New answers, comments, and votes are closed.