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

gui visibility changing script not working at all?

Asked by 3 years ago

so i made a script and a remote event to change textbuttons visibility im not getting any errors and its not working

remote local script (the local script is in startergui):

local button = game.Players.LocalPlayer.PlayerGui.Start.TextButton
local event = game.ReplicatedStorage.Events:WaitForChild("StartVisible")
event.OnClientEvent:Connect(function(plr)
    button.Visible = true
end)

and the script which is supposed to fire the remote:

local remote1 = game.ReplicatedStorage.Events:WaitForChild("StartVisible")
game.Players.PlayerAdded:Connect(function(plr)
    wait(5)
    if plr.Name == game.ServerStorage.Owner.Value then
        if game.ServerStorage.GameInProgress.Value == false then
            remote1:FireClient(plr)
        end
    end
end)

1 answer

Log in to vote
0
Answered by 3 years ago

Alright, I love the effort! There is no need to use RemoteEvent's, value's or anything to change the visibility of a Frame or any GUI object, it's easy as:

frame.Visible = false

Yes, it's that easy! In your case:

local frame = INDEX FRAME HERE

game.Players.PlayerAdded:Connect(function(plr)
    wait(5)
    if plr.Name == game.ServerStorage.Owner.Value then
        if game.ServerStorage.GameInProgress.Value == false then
            frame.Visible = true
        end
    end
end)

If you still don't understand please watch my video on visible/invisible GUI object's: https://www.youtube.com/watch?v=JouQxfkjB-s

If this helped please mark as solved!

0
thanks for the answer but this was 3 days ago i already fixed that, still thanks for help TFlanigan 86 — 3y
0
Oh ok, no problem, sorry for late response! KadenBloxYT 135 — 3y
Ad

Answer this question