So In my game you click on the item button to "buy" it, so it removes the tool from server storage to the starter pack.
It doesn't work though, and my output doesn't give me any errors. Help?
ORIGINAL SCRIPT:
local placeplant = game.ServerStorage:WaitForChild("PlaceBasicPlant")
local price = 0
usestat = "Coins"
function onClicked()
game.Players.LocalPlayer.leaderstats[usestat].Value = game.Players.LocalPlayer.leaderstats[usestat].Value - 0
placeplant:Clone()
placeplant.Parent = game.StarterPack
end
script.Parent.MouseButton1Click:connect(onClicked)

2 comments
Thank you for the answer, if it works I will accept the answer. Also it is basically buying the item, that is why it takes away money, however it is free so I just put - 0.
It sadly did not work. I used the script, I also checked the output. No errors, but it didn't work.