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)
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!