I have a local script that works on a player, and I want it to activate on the player who types in the command ":goku me". Yes, this is the goku localscript. Answers are appreciated! Thanks!! P.S Filtering is enabled, and this will work only for certain players.
Attempt:
1 | game.Players.PlayerAdded:connect( function (player) |
2 | if player.Name = = "MrNicNac" then |
3 | player.Chatted:connect( function (msg) |
4 | msg = :goku me |
5 | --not sure how to activate the localscript here |
6 | end ) |
7 | end |
8 | end ) |
Thanks for replying!
You need to catch the command inside of chat. have you forked all/part of chat? I think there's a spot you can add hooks to messages and check if they match your text.
I assume for this you will need the data on the server. So you'll need to have a way to communicate it to the local script, too. To get data back and forth you'll need remote events or remote functions: http://wiki.roblox.com/index.php?title=Remote_Events_and_Functions
Also, in terms of organization rather than setting up the username check during the playeradded, you can think of it like this: