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

How to save the value of a script being disabled?

Asked by 3 years ago

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!

0
I can't quite understand this, you want to change the player's textlabel.text to completed, when the player finished it? xXLegendGamerz16Xx 231 — 3y
0
I assume you have data store to store levels, you can just check if a script is disabled by "script.Disabled == true" xXLegendGamerz16Xx 231 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

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.

Ad

Answer this question