When i purchase a tool the scripts inside of it doesn't work

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!

1 Like

Are you giving the item from a script or a local script?

3 Likes

from a local script (30 characters)

1 Like

That wont’ work, you need to give the tool from a script.

2 Likes

oh okay thank you that worked!

2 Likes