Hello, so i just finished making a tool shop for my game the tool in the starterpack works be cause when i activate it it works but when i buy one from the shop it gives it to me but the scripts inside of it are not working even if its the same scripts that are on the one in the starterpack here is are the scripts inside of it:
local cooldown = false
script.Parent.Activated:Connect(function()
if not cooldown then
cooldown = true
script.Parent.Add:FireServer()
wait(0.05)
cooldown = false
end
end)
local ammount = script.Parent.Ammount.Value
script.Parent.Add.OnServerEvent:Connect(function(player)
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + ammount
if player.leaderstats.Coins.Value >= player.leaderboard.DNA.Value then
player.leaderstats.Coins.Value = player.leaderboard.DNA.Value
end
end)
Thank you!