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

how would i let a model give me money overtime in my leaderstat automatically?

Asked by 2 years ago
Edited by appxritixn 2 years ago

In my game, I have a cloning script so when you purchase the model, your money goes down and the model spawns in. What i want it to do is when you spawn in the model, it gives you money overtime automatically in your leaderstat. What would i add to my clone script to make this possible?

Script:

local button = script.Parent 
local gui=button.Parent 
local player=gui.Parent.Parent.Parent

button.MouseButton1Click:Connect(function()
    if player.leaderstats.racks.Value>=200 then
        player.leaderstats.racks.Value-=200

        ClonedTalent = game.ServerStorage.Talents.Ben:Clone() 
        ClonedTalent.Parent = game.Workspace ClonedTalent.Name = "Talent" 
    end
end

Answer this question