So Im making a gui where you can buy an item and then it takes 250 coins from your leaderstats. It also saves the item. I have it working untill it saves your item. Heres the code so far.
if game.Players.LocalPlayer.leaderstats:FindFirstChild(“Speed”) ~= nil then
script.Parent.Text = “Already Owned”
else
script.Parent.MouseButton1Click:connect(function()
if game.Players.LocalPlayer.leaderstats.Coins.Value >= 250 then
local Instance1 = Instance.new(“TextLabel”)
Instance1.Parent = game.Players.LocalPlayer.leaderstats
Instance1.Name = “Speed”
game.Players.LocalPlayer.leaderstats.Coins.Value = game.Players.LocalPlayer.leaderstats.Coins.Value - 250
script.Parent.Text = “Bought”
script:Destroy()
endend) end
I don’t have any clue how to save the “Speed” can someone help me. Thanks for reading.