Chat command isn't working

So I’m just trying to have a chat command set the ScreenGui to enabled for a raid system. I tried putting prints after the initial “;activate” and it doesn’t even print there. I am very confused because in a similar script this seemed to work, the only thing I am doing differently is checking for their rank and group. Although why the line before that doesn’t seem to work either has me stumped.


local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
		player.Chatted:Connect(function(message)
		if message == ";activate" then
			if player:IsInGroup(4545766)and player:GetRoleInGroup(4545766) == "||Developer||" then
				player.PlayerGui:WaitForChild("RaidSystem")
				player.PlayerGui.RaidSystem.Enabled = true
			end
		end
	end)
end)

So, I think this actually does work, it’s just not working in my game that has kohl’s admin. Does anyone know how to do this in a way that wouldn’t conflict with another admin? I’ve tried changing the activation message and it doesn’t seem to work.

I was wrong, the issue was not with kohl’s admin. I tried removing it and it still won’t work on that specific game for some reason. It does work on my other game when I use visibility instead of enabling the GUI, though I don’t assume that’s the problem.

Try this by replacing:

if player:IsInGroup(4545766)and player:GetRoleInGroup(4545766) == “||Developer||” then

to

if player:GetRankInGroup(4545766) == (Group role rank number) then

That line worked in my other game, why wouldn’t it work in this one? I can’t currently view the rank numbers.

I accidentally put this in server storage instead of server script service. My apologies for wasting your time.

Try putting the GUI in “Replicated Storage” and in the script, under the if statement on checking the players rank you can add:

game.ReplicatedStorage.RaidSystem:Clone().Parent = player.PlayerGui

Make sure the gui is visible, i’m hoping this method works.