The Problem is Why the Part(from the Dropper)not Destroy and not give a cash if the part Destroy at the PartCollector?
script.Parent.Parent.PartCollector.Touched:Connect(function(Part) if Part.Touched(function(Player) game.Workspace.Part.Destroy:(function(Part) if game.Workspace.Part.Destroy:() then stats.Cash.Value + 10 end end) end end)
Fix what's wrong with this script, if you can make it :)
Thanks :)
You cannot use an if statement for a function in lines 2 and 4
the destroy
function cannot be used like that, either, in line 3(i don't think)
Here is a fixed script:
script.Parent.Parent.PartCollector.Touched:Connect(function(Part) Part.Touched:Connect(function(Player) game.Workspace.Part:Destroy() stats.Cash.Value = stats.Cash.Value + 10 -- you cannot say "stats.Cash.Value + 10" end) end)
If statements: https://education.roblox.com/en-us/resources/if-then-statements
Destroy: https://developer.roblox.com/en-us/api-reference/function/Instance/Destroy
Operators: https://developer.roblox.com/en-us/articles/Operators
Hope this helps