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

How do I make an OnChatted event check for a specific player?

Asked by 5 years ago
game.Players.PlayerAdded:Connect(function(plr)
    plr.Chatted:Connect(function(msg)
        if msg == '/kick' then
            print("kick")
        end
    end)
end)

Where it says if msg == 'kick', I want to see if i can find a player name by saying "(prefix)kick NAME". Any solutions?

0
@RobloxWhizYT `(7, #msg)` that's redundant; you don't need the `#msg` bit. `sub` will get the rest of the string, starting at position 7. `print(string.sub('boop', 2)) --> oop` TheeDeathCaster 2368 — 5y
0
True. DeceptiveCaster 3761 — 5y

Answer this question