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

Transparent Part Script Not Working?

Asked by 8 years ago

So I have a script that when (h) touches the brick, the child of (h), Drink1 should become 0.1 transparency but the script works but it does not make the brick turn 0.1 transparent. Why?

function tch(h)
if (h.Parent.Name == "Drink1") then
h.Parent.Name = "HamDink"   --Edit this to the name of the drink
h.Parent.Transparency = 0.1 -- change this to the transparency
script.Parent.Parent.Spill.Transparency = 0.1
wait(0.5)
script.Parent.Parent.Spill.Transparency = 1 --no touchy
end
end

script.Parent.Touched:connect(tch)

1 answer

Log in to vote
0
Answered by 8 years ago

If "H" is a part, then "H" will have to be transparent. It looks like you are trying to make a model transparent, so try this.

function tch(h)
if (h.Parent.Name == "Drink1") then
h.Parent.Name = "HamDink"   --Edit this to the name of the drink
h.Transparency = 0.1 -- change this to the transparency
script.Parent.Parent.Spill.Transparency = 0.1
wait(0.5)
script.Parent.Parent.Spill.Transparency = 1 --no touchy
end
end

script.Parent.Touched:connect(tch)

Ad

Answer this question