Hey, i am having an issue with the new tycoon i am making. But there is a cash value in the part.
Code:
script.Parent.Touched:Connect(function(Part)
local db = false
if db == false then
db = true
if Part:FindFirstChild("Cash") then
local Partdecor = Instance.new("ParticleEmitter",script.Parent)
Partdecor.Texture = "http://www.roblox.com/asset/?id=300899516"
Partdecor.Lifetime=NumberRange.new(1,2)
Partdecor.Rate = 2
if Part.Parent == nil then
wait(1)
Partdecor:Destroy()
end
spawn(function()
script.Parent.Parent.Parent.CashToCollect.Value = script.Parent.Parent.Parent.CashToCollect.Value + Part.Cash.Value
Part:Destroy()
end)
end
wait(.2)
db = false
end
end)
- Error : Cash is not a valid member of Part "Part"

1 comment
dont forget to accept my answer if it worked!