Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Transparent Part Script Not Working?

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

✓ Accepted answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.