generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

On chatted script

Previous Thread :: Next Thread 
NightPyro is not online. 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
wafles26122 is not online. wafles26122
Joined: 14 Jun 2010
Total Posts: 958
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 is not online. 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
wafles26122 is not online. wafles26122
Joined: 14 Jun 2010
Total Posts: 958
21 Jun 2012 05:32 PM
um....no I'm pretty sure that wouldn't work C0okiez.....
Report Abuse
NightPyro is not online. NightPyro
Joined: 22 Apr 2012
Total Posts: 183
21 Jun 2012 05:58 PM
Ok thankyou.
Report Abuse
are31 is not online. 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 is not online. 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
ServerLabs is not online. ServerLabs
Joined: 29 Dec 2010
Total Posts: 2263
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 is not online. 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 is not online. 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
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
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 is not online. 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 is not online. NightPyro
Joined: 22 Apr 2012
Total Posts: 183
21 Jun 2012 11:42 PM
No thank you ninja, but thank you anyways.
Report Abuse
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
21 Jun 2012 11:42 PM
wrong = "UMG I HAD CAPSLOCK ON"
fixed = wrong:lower()

print(fixed)
Report Abuse
ServerLabs is not online. ServerLabs
Joined: 29 Dec 2010
Total Posts: 2263
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image