Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a gui appear when I say, "/OpenGui"?

Asked by
Aqu_ia 39
5 years ago
local RaidCommand = "/BeginRaid"
local function onPlayerChatted(player, message, recipient)
if message:sub(1, RaidCommand:len()):lower() ==     RaidCommand:lower() then
script.Parent.Visible = true
script.Parent.Parent.Background.Visible = true
script.Parent.Visible = false
wait(4)
script.Parent.Parent.Background.Visible = false
script.Parent.Visible = true
end
end
local function onPlayerAdded(player)
player.Chatted:Connect(function(...)
onPlayerChatted(player, ...)
end)
end
Players.PlayerAdded:Connect(onPlayerAdded)

1 answer

Log in to vote
0
Answered by
Alphexus 498 Moderation Voter
5 years ago

This should help:

game:GetService("Players").PlayerAdded:Connect(function(player)
    player.PlayerChatted:Connect(function(message)
        if message == "[Put your message here]" then
            -- Do stuff -- 
        end
    end)
end)
Ad

Answer this question