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

My script to change button visibility is not working ?

Asked by 6 years ago
Edited 6 years ago

Well it is so, To a home screen, when and clicked to start this frame is visible = false, hence I try that after this frame becomes false appears the button to teleport to the map, but I am not getting

script.Parent.MouseButton1Click:connect(function()
    if game.StarterGui.BackGroundGUI.Frame.Visible == false then
        script.Parent.Visible = true
    end
 game.Players.LocalPlayer.character.LowerTorso.CFrame = CFrame.new(workspace.Point.Position)
 script.Parent.Visible = false
end)

OBS : If I was in doubt in this game https://www.roblox.com/games/1504622981/Up-Power-Coming-Soon

0
Lmao, I see a major error here.... It is 100% working but you are using StarterGui on line 2... try using this: game.Players.LocalPlayer.PlayerGui.BackGroundGUI.Frame.Visible == false then greatneil80 2647 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

You're changing the Visibility of the StarterGui.

You need to change the Visibility of the BackGroundGUI of the player like so:

local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
    if player.PlayerGui.BackGroundGUI.Frame.Visible == false then
        script.Parent.Visible = true
    end
 player.character.LowerTorso.CFrame = CFrame.new(workspace.Point.Position)
 script.Parent.Visible = false
end)
0
Hey you are br ? Goodbye_Fx 29 — 6y
Ad

Answer this question