#PLS help me its for my tycoon

37 messages · Page 1 of 1 (latest)

subtle yarrow
#

you trying to index nil aka nothing with a value

#

i hope that clears it

turbid pagoda
#

i cant send a screenshot of the code but this is the code

#

local values = script.Parent.Parent.Parent.Parent.Values

script.Parent.Touched:Connect(function(hit)
if hit.Name == "DropperPart" and hit:IsA("BasePart") then
values.MoneyValue.Value += hit:FindFirstChild("CashValue").Value
hit:Destroy()
end
end)

subtle yarrow
#

you forget the

#

word .parent

#

in the hit

turbid pagoda
#

local values = script.Parent.Parent.Parent.Parent.Values

script.Parent.Touched:Connect(function(hit)
if hit.Name == "DropperPart" and hit.parent:IsA("BasePart") then
values.MoneyValue.Value += hit:FindFirstChild("CashValue").Value
hit:Destroy()
end
end)

#

@subtle yarrow so like this?

#

bcs it doesn't work either

subtle yarrow
#

bro

#

wait

#

wyd

#

why you checking if the player or part that touched the Touchable Part name is dropper part and that it is a basepart?

#

any ways this correct version btw

#
local values = script.Parent.Parent.Parent.Parent.Values

script.Parent.Touched:Connect(function(hit)
    if hit.Parent.Name == "DropperPart" and hit.Parent:IsA("BasePart") then
        values.MoneyValue.Value += hit:FindFirstChild("CashValue").Value
        hit.Parent:Destroy()
    end
end)
turbid pagoda
#

i ckeck it bcs nothing else can get destroyed

frosty prairie
turbid pagoda
#

no it doesnt work 😦

summer knotBOT
#

studio** You are now Level 1! **studio

turbid pagoda
frosty prairie
turbid pagoda
#

this is a video of my code and the error

frosty prairie
#

I can’t open YouTube rn

#

Send screenshot of console and send code

frosty prairie
turbid pagoda
#

i cant send screenshots for some reason

frosty prairie
#

Dm it to me

subtle yarrow
#

tbh i think the whole script it self is wrong

frosty prairie
subtle yarrow
#

wdym.

frosty prairie
#

Like it’s terrible code but you can’t expect everyone to have good code as a beginner

subtle yarrow
#

ye

#

you are right tbh

frosty prairie
#

I found the problem with his code tho

subtle yarrow
#

what was it

frosty prairie
# subtle yarrow what was it

It’s not fully fixed cus he has another problem now but it was just an problem with naming being inconsistent across 2 scripts