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 » Scripters
Home Search
 

OnChattedKill

Previous Thread :: Next Thread 
KAMIKAZEPOLO is not online. KAMIKAZEPOLO
Joined: 14 Mar 2012
Total Posts: 1049
24 Jul 2015 12:00 AM
For some reason this script won't work.


function onChatted(msg, recipient, speaker)

local source = string.lower(speaker.Name)

msg = string.lower(msg)

if (msg == "kill") and speaker.Name == "Username" then
for i, v in pairs(game.Players:GetPlayers()) do
if v.Character then
local char = v.Character
local hum = char:FindFirstChild("Humanoid")
if hum then
hum:TakeDamage(hum.MaxHealth)

end end end end


function onPlayerEntered(newPlayer)

newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)

end

game.Players.ChildAdded:connect(onPlayerEntered)


Any replies are appreciated :D
Also thanks to instawin for helping me with killing all players :D
Report Abuse
WillieTehWierdo200 is not online. WillieTehWierdo200
Joined: 13 Aug 2008
Total Posts: 1147
24 Jul 2015 02:10 AM
Output?
Also, did you try replacing

> speaker.Name == "Username"

with the username of the person using the command?
Report Abuse
KAMIKAZEPOLO is not online. KAMIKAZEPOLO
Joined: 14 Mar 2012
Total Posts: 1049
24 Jul 2015 03:17 AM
There were no syntax errors, and I did, of course, replace username with the person.
Report Abuse
FactualTheory is not online. FactualTheory
Joined: 10 Sep 2013
Total Posts: 1365
24 Jul 2015 03:29 AM
I am not perfect at this,

correct me if I am wrong;

it does kill yourself? right?
Report Abuse
KAMIKAZEPOLO is not online. KAMIKAZEPOLO
Joined: 14 Mar 2012
Total Posts: 1049
24 Jul 2015 03:33 AM
It kills the entire server.
Report Abuse
KAMIKAZEPOLO is not online. KAMIKAZEPOLO
Joined: 14 Mar 2012
Total Posts: 1049
24 Jul 2015 03:38 AM
Fixed it, forgot I renamed humanoid, lol.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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