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

How to save the value of a script being disabled?

Hi, I'm working on a gui that lets you get levels and if you reach a certain amount of levels, you complete the quest and it gives you gems which can be used to buy other things, the problem is that I'm not sure how I would save it.

This is the script:

local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
	if player.leaderstats.Levels.Value >= 100 then 
		print("Has Gems!")
		player.leaderstats.Gems.Value = player.leaderstats.Gems.Value + 100
		script.Parent.TextSize = 22
		script.Parent.Text = "Completed"
		script.Disabled = true
	end
end)

I want it to save the completed text and the disabled value in the script.

Thanks In Advance!

2 comments

0

I can't quite understand this, you want to change the player's textlabel.text to completed, when the player finished it?

0

I assume you have data store to store levels, you can just check if a script is disabled by "script.Disabled == true"

1 answer

Sorry if I was not clear, I want to save the text saying "Completed" and in the script it says that once the text is completed, the script auto disables it. I want to save it script being disabled as well.

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