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

So this is for a cup fill up How do I make water apper in it? (read desc!)

So line 9 is what is not working! I would like that to turn visible to people after it runs the rest of the script how do I do this??


function tch(h)
if (h.Parent.Name == "Cup") then
h.Parent.Name = "Water"
script.Parent.Sound:Play()
script.Parent.Parent.Spill.Transparency = 0.5
wait(0.5)
script.Parent.Parent.Spill.Transparency = 1
wait(2)
game.StarterPack.Cup.D1.Transparency = 0
end
end

script.Parent.Touched:connect(tch)

7 comments

0

if you want it visible then the transparency needs to be 0 and not 1, maybe you meant invisible but that might be your problem.

0

DUH!!! im so Dumb thank you xD

0

Wait that did not work!

0

are you getting an error or is it just not showing up for people?

0

No Error at all output is clean and so is script its just not showing up in the cup its just a part I added in the cup that is suppose to turn visible after they put it by the water giver.

0

@NvidiaGeForce2080Ti

0

I have no idea then

2 answers

function tch(h)
if (h.Parent.Name == "Cup") then
h.Parent.Name = "Water"
script.Parent.Sound:Play()
script.Parent.Parent.Spill.Transparency = 0.5
wait(0.5)
script.Parent.Parent.Spill.Transparency = 1
wait(2)
game.StarterPack.Cup.D1.Transparency = 0
end
end

script.Parent.Touched:connect(tch)

It shouldn't be Starterpack, it should be their backpack. Starterpack will only load on spawn, while backpack is their current pack. Backpack can be really useful to give items to them or change the items. So it would be:

function tch(h)
if (h.Parent.Name == "Cup") then
h.Parent.Name = "Water"
script.Parent.Sound:Play()
script.Parent.Parent.Spill.Transparency = 0.5
wait(0.5)
script.Parent.Parent.Spill.Transparency = 1
wait(2)
game.Players.LocalPlayer.Backpack.Cup.D1.Transparency = 0 --I changed this line only
end
end

script.Parent.Touched:connect(tch)

Hope it works!

2 comments

0

It did not work I dont know why there is no error in the output! but its not working I even tried the other way making it disapear but nothing so whats going on :(

0

Well this is tricky... I can't think of a solution other than that, but make sure you use Backpack instead of StarterPack in the future. I hope you can find an answer!

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