NightPyro
|
  |
| Joined: 22 Apr 2012 |
| Total Posts: 183 |
|
|
| 21 Jun 2012 05:29 PM |
| How do you do that? Like an admin script. How would a chat script look like? |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2012 05:31 PM |
function entered(player) player.Chatted:connect(Chatted) -- connect chat event here end game.Players.PlayerAdded:connect(entered)
function Chatted(msg) if msg == "hi" then print("hi") end end |
|
|
| Report Abuse |
|
|
C0okiez
|
  |
| Joined: 01 Jan 2009 |
| Total Posts: 10 |
|
|
| 21 Jun 2012 05:31 PM |
admin = game.Players.C0okiez --- Put your name where mine is obv :L
while true do
wait(0.1)
function chatted(msg)
------What you want to happen when you talk.
end
admin.Chatted:connect(chatted)
end
There yeh go :3, anything else? |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2012 05:32 PM |
| um....no I'm pretty sure that wouldn't work C0okiez..... |
|
|
| Report Abuse |
|
|
NightPyro
|
  |
| Joined: 22 Apr 2012 |
| Total Posts: 183 |
|
| |
|
are31
|
  |
| Joined: 09 Nov 2007 |
| Total Posts: 13767 |
|
|
| 21 Jun 2012 07:01 PM |
game.Players.PlayerAdded:connect(function(player) if player.Chatted == "kill" then player:findFirstChild("Humanoid") player.Humanoid.Health = 0 end end)
I think this works... kills yourself when you say kill. I wrote this from memory so there might be a few errors. |
|
|
| Report Abuse |
|
|
C0okiez
|
  |
| Joined: 01 Jan 2009 |
| Total Posts: 10 |
|
|
| 21 Jun 2012 08:07 PM |
| Noo... im using it right now so im pretty sure it does :3 if your refering to the bit inside the function its where commands can be placed i just chose to not share any :D |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2012 08:15 PM |
C0okiez, that is perhaps the most inefficient script I've ever seen. Honestly.
@OP The .Chatted event works like this:
game.Players.Player.Chatted:connect(function(args) print(args); end)
Whatever "Player" says will be carried over to /args/.
I.E. Player - "Hi" > Hi
Player - "kill/Noob" > kill/Noob
-----------------------
By using those args with the string manipulation library, you can effectively create admin commands:
Speaker = game.Players.ServerLabs function ChatCommands(_message) if string.sub(_message, 1, 5) == "kill/" then p = game.Players:GetChildren() for i=1, #p do if string.sub(_message, 6) == p[i].Name then p[i].Character:BreakJoints() print("killed " ..p[i].Name) end end end end Speaker.Chatted:connect(ChatCommands)
ServerLabs - "kill/Somenoob" > killed Somenoob |
|
|
| Report Abuse |
|
|
TanTecho
|
  |
| Joined: 29 Jun 2011 |
| Total Posts: 33 |
|
|
| 21 Jun 2012 08:42 PM |
I'm not exactly the BEST scripter... But, try using a simple "chat change team" script and edit it to your likeing. There is also a "kill player chat" script that may work, liek I said before, edit it, and add soem of the EPIC scripts above to it... You might just get the best script ever! :D Hope this helped :P
~Techo ~ROBLOX Forum Helper |
|
|
| Report Abuse |
|
|
NightPyro
|
  |
| Joined: 22 Apr 2012 |
| Total Posts: 183 |
|
|
| 21 Jun 2012 11:34 PM |
| Well thankyou i'm just building a place, and you just say commands then it does something. |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2012 11:40 PM |
| Wanna know how to make it so you can use stuff like ban/n or ban/me etc.? I can show ya if you want :D |
|
|
| Report Abuse |
|
|
NightPyro
|
  |
| Joined: 22 Apr 2012 |
| Total Posts: 183 |
|
|
| 21 Jun 2012 11:41 PM |
| Wait is there a way on roblox to make strings not Case Sensitive, so like no matter what the person types like Hi hI Hi.hi. The computer still see's you've said hi. |
|
|
| Report Abuse |
|
|
NightPyro
|
  |
| Joined: 22 Apr 2012 |
| Total Posts: 183 |
|
|
| 21 Jun 2012 11:42 PM |
| No thank you ninja, but thank you anyways. |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2012 11:42 PM |
wrong = "UMG I HAD CAPSLOCK ON" fixed = wrong:lower()
print(fixed) |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2012 02:50 PM |
NightPyro
if string.sub(somestring:lower(), x, y) == "stuff/person" then
The :lower() method (string.lower() function) makes a string lowercase |
|
|
| Report Abuse |
|
|