Hello,
I want to make so if a tool touch something he will get money after some seconds! This is the script i using now that are wrong:
Money = "Cash" GetMoneyFromTree = "100" WaitForMoney = 10 script.Parent.Touched:connect(function(hit) if hit.Parent.Name == "Tool" then script.Parent.Anchored = false wait(10) game.Players.LocalPlayer.leaderstats[Money].Value = game.Players.LocalPlayer.leaderstats[Money].Value + 100 end end)
That script is wrong.
Can someone help me with this script??
Hello, Lava_Scripter!
You don't test if a item has the name of tool(if you REALLY want this, you do)
You use :IsA("Tool")
to test if part is a tool
Edited script:
Money = "Cash" GetMoneyFromTree = "100" WaitForMoney = 10 script.Parent.Touched:connect(function(hit) if hit.Parent:IsA("Tool") then script.Parent.Anchored = false wait(10) game.Players.LocalPlayer.leaderstats[Money].Value = game.Players.LocalPlayer.leaderstats[Money].Value + 100 end end)
Good Luck with your games!