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

ChattedEvent - Help?

Asked by 9 years ago
game.Players.Chatted:connect(function()
    if game.Players.JustARegularGuy804.ClassicChat == 'supermario64' then
        game.StarterGui.AdminGui:Clone()
        game.Players.JustARegularGuy804.PlayerGui.AdminGui = true
    else
        if game.Players.JustARegularGuy804 == false then
            for i, player in ipairs(game.Players:GetPlayers()) do
            local character = player.Character -- This grabs all of the players.
            character:BreakJoints()
        end
    end
end
end)

I've tried it, but it doesn't work. I don't seem to know what I did wrong (AND ADMINGUI IS IN THE STARTERGUI) So, what the script does is when JustARegularGuy804 chats supermario64, the AdminGui pops up, because he has permission. IF JUSTAREGULARGUY804 IS NOT IN THE GAME, HOWEVER. Then everyone in the game dies. Happy ending.

1 answer

Log in to vote
0
Answered by 9 years ago

Don't use ClassicChat, I'm not even sure where you got that from, never heard of it. Basically this checks to make sure that the player chatting is justaregularguy, if it is you, then it procedes and uses player.Chatted. You then lower the message(you can take that out if you like) and see if the lowered message is equal to supermario, if it is, open gui, else, kill the players. Hope this helps, let me know if it still doesn't work or you have any other questions on the subject!

game.Players.PlayerAdded:connect(function(player)
        player.Chatted:connect(function(msg)
        lower = string.lower(msg)
        if (lower == "supermario64") and (player.Name == "JustARegularGuy804") then
            --Open admin gui
        else
            --Kill the players
        end
        end)
    end
end)
Ad

Answer this question