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
 

testing a kill and kick script

Previous Thread :: Next Thread 
cade2000 is not online. cade2000
Joined: 09 Aug 2009
Total Posts: 887
25 Jul 2014 07:01 PM
I can't figure out whats wrong with this!!!

-_-

function chat(msg,p)
if string.sub(msg,1,2) == "k " then
if game.Players[string.sub(msg,3,-1)].Character.Head ~= nil then
game.Players[string.sub(msg,3,-1)].Character.Head:Destroy()
end
end

if string.sub(msg,1,2) == "b " then
if game.Players[string.sub(msg,3,-1)] ~= nil then
game.Players[string.sub(msg,3,-1)]:Destroy()
end
end
end

game.Players.cade2000.Chatted:connect(chat)

It's so simple, what's wrong with it?
Report Abuse
MomoiroCloverZ is not online. MomoiroCloverZ
Joined: 06 Jan 2013
Total Posts: 825
25 Jul 2014 07:05 PM
When the game first starts up (aka when the script runs)
game.Players.cade2000 = nil


MomoiroCloverZ, newbag expert Lua coder.
Report Abuse
cade2000 is not online. cade2000
Joined: 09 Aug 2009
Total Posts: 887
25 Jul 2014 07:05 PM
Seriously, whats wrong with this??
It seems to be completely fine..
Report Abuse
cade2000 is not online. cade2000
Joined: 09 Aug 2009
Total Posts: 887
25 Jul 2014 07:05 PM
No I'm running the script in a script builder to test it, that couldn't be the case.
Report Abuse
dreaddraco2 is not online. dreaddraco2
Joined: 01 Dec 2007
Total Posts: 6275
25 Jul 2014 07:06 PM
What problems are you having?

(Btw, it's case sensitive so K or B won't work while k or b might)
Report Abuse
cade2000 is not online. cade2000
Joined: 09 Aug 2009
Total Posts: 887
25 Jul 2014 07:08 PM
Nothing is happening, the script builder I'm using has no output as well...

can't test in studio because you have to chat.
Report Abuse
MomoiroCloverZ is not online. MomoiroCloverZ
Joined: 06 Jan 2013
Total Posts: 825
25 Jul 2014 07:09 PM
function chat(msg,p)
if string.sub(msg,1,2):lower() == "k " then
if game.Players[string.sub(msg,3)] and game.Players[msg:sub(3)].Character and
game.Players[msg:sub(3)].Characters.Head ~= nil then
game.Players[string.sub(msg,3)].Character.Head:Destroy()
end
end

if string.sub(msg,1,2):lower() == "b " then
if game.Players[string.sub(msg,3)] ~= nil then
game.Players[string.sub(msg,3)]:Destroy()
end
end
end

game.Players.cade2000.Chatted:connect(chat)



MomoiroCloverZ, newbag expert Lua coder.
Report Abuse
cade2000 is not online. cade2000
Joined: 09 Aug 2009
Total Posts: 887
25 Jul 2014 07:11 PM
Didn't work, maybe the script builder is blocking the script somehow..
Report Abuse
dreaddraco2 is not online. dreaddraco2
Joined: 01 Dec 2007
Total Posts: 6275
25 Jul 2014 07:14 PM
Try removing the "p" parameter so that it's just "(msg)".
Just a hunch.
Report Abuse
DigitalSyntax is not online. DigitalSyntax
Joined: 11 Jul 2012
Total Posts: 14
25 Jul 2014 07:19 PM
You can chat in studio.
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