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

How would I link this script to a part?

Asked by 8 years ago

Hello, I am working on a script so when it detects the Parent.Name of the tool is Raw Hamburger, it will change the tool name to Hamburger. But on line 5, what would I replace h.Parent.Drink.BrickColor with because I need it like this h.Workspace.Hamburger.Child.Cup, but that will not work. So how would I link this script to another part?

function tch(h)
if (h.Parent.Name == "Raw Hamburger") then
h.Parent.Name = "Hamburger"
wait(0.5)
h.Parent.Drink.BrickColor = script.Color.Value
h.Parent.Drink.Transparency = 0
end
end

script.Parent.Touched:connect(tch)
1
You can refference any part as long as you have access to it, but i do not fully undestand what your question is? User#5423 17 — 8y

Answer this question