Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can someone tell me why this won't work? I have tried everything. Help?

Asked by 7 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

I have a model called Regular Coffee Machine and the script works to make it regular coffee, but to make it more detailed, I want to add a spill. So I figured, I'd make a spill part, name it, "Spill2".. then make it Transparency 1. In the script, I made it so that it will turn to transparency 1 again. For some reason this won't work... Help?

Code:

script.Parent.Touched:connect(function(h)
    if h.Parent.Name == "EmptySmallCoffeeCup" then
        h.Parent.Name = "Small Regular Coffee"
            h.Parent.Spill2.Transparency = 0
            wait(.5)
            h.Parent.Spill2.Transparency = 1
    end
end)

1
What does output say? Tempestatem 884 — 7y
0
it says that Spill2 is not a valid number of Tool.. But I have it in the tool too. wolfbarrier123 -25 — 7y
0
Try using :WaitForChild() and make sure it's spelled right. antonio6643 426 — 7y
0
After the Spill goes to Transparency 1? wolfbarrier123 -25 — 7y

Answer this question