I need to create a pm script that returns a player from a for i, v in pairs(table) loop Example: /pm Gui;How are you doing. It will make a box appear on GuiHelperSince2014's screen with How are you doing typed on it. The following code explains what my unfinished code is. (It's unfinished because I can not think of what to do)
for i, v in pairs(game.Players:GetPlayers()) do
if string.lower(string.find(string.sub(msg, 5,string.find(msg, ";") - 1))) then
CreatePMMessage(plr, v, msg, string.sub(msg, string.find(msg, ";") + 1))
end
end
The code is a chat script so plr is the plr that is added and msg is the message that the player chats. And CreatePMMessage is a function. The following code is the syntax of the function
CreatePMMessage(plr, plr2, msg, message)
plr is the sender, plr2 is the target, msg is for it to work (for some odd reason it needs this), and message is the pm message

3 comments
Okay, thank you, i forgot my email for my main account (Z9R) That I put on here so I use my other account to ask questions
Yep just what I wanted, Thank you very much!
you're welcome