Hi there! I am experiencing an issue that has me completely stumped. I have no idea what is wrong. So I turned to the forums, in order to find a solution.
Here’s the problem:
I’m trying to make the visibility of a GUI set to true for a player, but it’s not working. It does this when a player spawns in. Here’s what I tried:
So first I tried changing the player’s GUI from a server-script like this:
player.PlayerGui.MorphsGui.MorphsFrame.Visible = true
This didn’t work so I also tried making a remote event that fires to the client from the server:
ServerScript:
MorphGuiEvent:FireClient(player)
LocalScript:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local MorphGuiEvent = ReplicatedStorage:WaitForChild("MorphGuiEvent")
MorphGuiEvent.OnClientEvent:Connect(function(player)
print("This code was fired") -- It does fire
Players.LocalPlayer.PlayerGui:WaitForChild("MorphsGui").MorphsFrame.Visible = true -- Does not work
end)
This code still doesn’t make the GUI visible! I’m so confused, so any help will be appreciated!
Also there are no errors for both of the methods I’ve tried.
Thanks.