Issue with putting GUI visible on remote event

Hey everyone, how are you? I’m having some issues here… I have a server script that listens for a command and then it should fire a remote event. It seems to return this error:
image
I’ve tried replacing ‘PlayerGui’ with ‘ScreenGui’ and ‘StarterGui’
Here is the server script:

--//VARIABLES
local groupId = 1234567 
local adminRank = 0 
local commandName = "/teams" 

--//CODE
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("GUIAppear")


function onChatted(msg, speaker)
	if speaker:GetRankInGroup(groupId) >= adminRank then
		local source = string.lower(speaker.Name)
		msg = string.lower(msg)
		if string.find(msg, commandName) then
			remoteEvent:FireClient(speaker)
		else
		end
	end
end
game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:connect(function(msg)onChatted(msg, player) end)
end)

And, here is the LocalScript what seems to have the issue:

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local remoteEvent = ReplicatedStorage:WaitForChild("GUIAppear")

local function showGUI(speaker)
	speaker.PlayerGui.ScreenGui.Enabled = true
end


remoteEvent.OnClientEvent:Connect(showGUI)

Any help is appreciated, hope to get this working, thanks!

Try this

	game.Players.LocalPlayer.PlayerGui.ScreenGui.Enabled = true

Edit: I made a mistake It’s fixed now

1 Like

I made some changes you should try that.

1 Like