Don't judge me i'm new to scripting
But basically, when i try to add value to my "Job" leaderstat, my datastore doesn't find any problems, buy when i do it with this script, it won't save
Please help me
--[Variables] local jobstat = game.Players.LocalPlayer.leaderstats.Job local mainframe = script.Parent local maintextlabel = mainframe.CenterFrame.ChooseLocation --[Text Variables] local maintext = "Please choose your first location..." --[Pre-Starting Scripts] mainframe.Position = UDim2.new(0,0,-1.5,0) wait(4) --[Starting Scripts] if jobstat.Value >=1 then script.Parent.Parent:Destroy() else script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),"InOut","Sine",0.3) jobstat.Value = 1 for i = 1, #maintext do maintextlabel.Text = string.sub(maintext, 1, i) wait(0.02) end end
If filtering-enabled is on, local scripts don't have the ability to change the game. Try adding a Remote Event that will trigger this part of the code:
23 if jobstat.Value >=1 then 24 script.Parent.Parent:Destroy() 25 else 26 script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),"InOut","Sine",0.3) 27 jobstat.Value = 1 28 29 for i = 1, #maintext do 30 maintextlabel.Text = string.sub(maintext, 1, i) 31 wait(0.02) 32 end 33 end