Frozeis
|
  |
| Joined: 25 Jun 2015 |
| Total Posts: 35 |
|
|
| 14 Jul 2016 02:11 AM |
Yes, It was in the wrong thread. It was in game design and now technical support. I finally found the right place for this. If this is the wrong forum, I am sorry.
Now to get straight to what it said. It said this:
I didn't get any reply from my old thread. It is 3 days old. Is it okay if I repost this because I did not get any reply. Continuing on. Also, Delete the old thread in game design forum.
Yes, I know. Again. Sorry if I posted this too soon. Let's get straight to the point.
Now, I need scripting assistance. I have "me" and player name now but not all. My "all" was not working. Here it is:
function onChatted(player, message) local function findPlayer(name) local plrz = {} -- Specific types of things you can use. For example: :kill all (This kills all players.) -- Example 2: :fire builderman (This sets builderman on fire.) for _, plr in ipairs(game.Players:GetPlayers()) do if plr.Name:lower() == name:lower() then return plr elseif name == "me" then return player end end end end
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(message) onChatted(message, player) end) end) |
|
|
| Report Abuse |
|
|
|
| 14 Jul 2016 02:19 AM |
| You clearly didn't write this yourself, if you did you should be able to figure it out on your own. |
|
|
| Report Abuse |
|
|
calvin56
|
  |
| Joined: 18 May 2007 |
| Total Posts: 784 |
|
|
| 14 Jul 2016 05:03 AM |
me should be your player name, not me
|
|
|
| Report Abuse |
|
|
Frozeis
|
  |
| Joined: 25 Jun 2015 |
| Total Posts: 35 |
|
|
| 15 Jul 2016 04:25 PM |
| I did write it myself. I did not steal it from anything. |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2016 04:29 PM |
Wait a second, so the problem is that 'all' wasn't working?
here:
function onChatted(player, message) local function findPlayer(name) local plrz = {} for _, plr in ipairs(game.Players:GetPlayers()) do if plr.Name:lower() == name:lower() then return plr elseif name == "me" then return player elseif name == 'all' then for i,v in pairs(game:GetService'Players':GetPlayers())do return v end end end end end
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(message) onChatted(message, player) end) end)
|
|
|
| Report Abuse |
|
|