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

3 comments
no one can click the button in starterGui. there's no need to have a server sided script involved in UI. UI's are supposed to be client-only in the first place.
How do I have it so that when I click it'll change the Player's Gui?