So I am making a shop and when you buy it, it of course gives you the item but then the item that is cloned to your inventory doesn't actually work as it supposed to. I have even moved the tool to my StarterPack and it works fine but when I put it in the shop it just doesn't work. This is the script inside the tool.
local Smasher = script.Parent
local Tool = Smasher.Parent
local PlayerModel = Tool.Parent.Parent
local Player = game.Players:FindFirstChild(PlayerModel.Name)
local debounce = false
local timer = 1
if debounce == false then
debounce = true
Smasher.Touched:Connect(function(hit)
if hit.Name == "SodaBottle" then
hit.Health.Value = hit.Health.Value - 25
if hit.Health.Value <= 0 then
hit:Destroy()
if Player.Sodas.Value < Player.MaxSodas.Value then
Player.Sodas.Value = Player.Sodas.Value + 1
end
end
end
end)
wait(timer)
debounce = false
end

1 comment
What does the tool do, and what is it supposed to do?