why wont this work?
script.Parent.Touched:connect(function(hit) if hit.Name == "Mouse" then game.StarterGui.a.t.Transparency = 1 end end)
why wont this work?
script.Parent.Touched:connect(function(hit) if hit.Name == "Mouse" then game.StarterGui.a.t.Transparency = 1 end end)
Modifying things in the StarterGui will modify the thing that is copied into each player upon spawn. However, it only changes the thing to be copied -- it won't change what any current players are seeing.
You'll need to loop through each player's Player gui:
for _, player in pairs(game.Players:GetPlayers()) do
player.PlayerGui.a.t.BackgroundTransparency = 1;
end
In addition, BackgroundTransparency instead of Transparency will make the object transparent. .Visible = false would actually hide the GUI element.
script.Parent.Touched:connect(function(hit) if hit.Name == "Mouse" then game.StarterGui.a.t.Visible = false end end)
Transparency is not a member. However, there is Backgroundtransparency . Problem is, a fully transparent gui is still clickable. So we use the visible property instead .
This discussion is preserved as it was. New answers, comments, and votes are closed.