I honestly don't understand why it actually stopped working, it was working yesterday on my laptop. I did have FilteringEnabled on too. Basically, if I click a button, it should turn off visibility for the first frame, and turn on visibility for the second frame.
Server Script
local RepStorage = game:GetService("ReplicatedStorage") local Function = RepStorage:WaitForChild("PlayEvent") wait(0.5) local StarterGui = game:GetService("StarterGui") local startgame = StarterGui:WaitForChild("StartGame") local frame = startgame:WaitForChild("Frame") local button = frame:WaitForChild("Play") local function ChangeGui(player) print(player.Name, "wants to change GUI.") Function:FireClient(player) end button.MouseButton1Click:Connect(ChangeGui)
LocalScript
wait(0.5) local RepStorage = game:GetService("ReplicatedStorage") local Function = RepStorage:WaitForChild("PlayEvent") local player = game.Players.LocalPlayer local playergui = player:WaitForChild("PlayerGui") local startgame = playergui:WaitForChild("StartGame") local frame = startgame:WaitForChild("Frame") local button = frame:WaitForChild("Play") local playframe = startgame:WaitForChild("PlayFrame") local function ChangeGui() if frame.Visible == true then -- if first frame visible frame.Visible = false -- visible off playframe.Visible = true -- other frame visible on else frame.Visible = true playframe.Visible = false end end Function.OnClientEvent:Connect(ChangeGui)
Could it be that I'm using "Function" as a variable, or could it be that ROBLOX has trouble getting RemoveEvents across? I really don't know, I'm new to FE lol.
Thanks,
LukeGabrieI
Local script:
local player = game.Players.LocalPlayer local playergui = player:WaitForChild("PlayerGui") local startgame = playergui:WaitForChild("StartGame") local frame = startgame:WaitForChild("Frame") local button = frame:WaitForChild("Play") local playframe = startgame:WaitForChild("PlayFrame") -- If playframe's parent is frame, and you set frame's visible to false, then both of them will not show. function SET_VISIBILITY() if (frame.Visible == true) and (not playframe.Visible) then frame.Visible = false playframe.Visible = true elseif (not frame.Visible) and (playframe.Visible == true) then frame.Visible = true playframe.Visible = false end end button.MouseButton1Click:connect(SET_VISIBILITY)
LocalScript inside the TextButton:
function onClick() -- No passable parameters. frame.Visible = not frame.Visible -- changed the current Visible state of the frame to its opposite. so if true then false if false then true. end script.Parent.MouseButton1Click:Connect(onClick)