I'm trying to make a simple chat command, a whitelisted player will be able to say "gui" and the GUI I chose should become visible. It will also say a message in console "GUI Script Working!" but it doesn't show the GUI, it only says the text in the console, does anyone know why this is happening? (I'm new to scripting sorry for the lack of knowledge.)
local isAdmin = {["Tantalingo"] = true} -- "Tantalingo" is my username
function findPlayer(name)
for _, player in ipairs(game.Players:GetPlayers()) do
if player.Name:lower() == name:lower() then
return player
end
end
end
function onChatted(message, player)
if message:sub(1, 5) == "gui" and isAdmin[player.Name] then
game.StarterGui.AccessUI.Main.Visible = true
print "GUI Script Working!"
end
end
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message) onChatted(message, player) end)
end)

1 comment
Instead of "Visible", try with "Enabled".