miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 24 Nov 2011 11:51 PM |
game.Players.PlayerAdded:connect(function(p) if p.Name == "miz656" then p.Chatted:connect(function(chat) local chat2 = chat:lower() if chat2 == "kill/"..p.Name then p.Character:BreakJoints() end end) end end)
It works but only kills me when I say kill/miz656(My name) |
|
|
| Report Abuse |
|
|
|
| 24 Nov 2011 11:54 PM |
Its supposed to. Because.. well your saying your name...
If thats not what you ment did you mean the script is ment to kill everyone?
|
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 24 Nov 2011 11:56 PM |
No lol Bad explanation
I mean it only works when I say kill/miz656
It doesn't work if I say another persons name. |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2011 12:01 AM |
Oh,
game.Players.PlayerAdded:connect(function(p) if p.Name == "miz656" then -- Here is your problem p.Chatted:connect(function(chat) local chat2 = chat:lower() if chat2 == "kill/"..p.Name then p.Character:BreakJoints() end end) end end)
You have to fix it so that its not if p.Name is Miz656 aswell. Because using
if p.Name == "miz656" then
so baisically p.Name is always going to be you...
Get what i mean?
|
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 25 Nov 2011 12:03 AM |
| That's what I was thinking too. But if I remove that then the chatted event will work for everyone. |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 25 Nov 2011 12:03 AM |
Well, I would say the problem is his chat2 if statement.
game.Players.PlayerAdded:connect(function(p) if p.Name == "miz656" then p.Chatted:Connect(function(chat) local chat2 = chat:lower() if string.sub(chat2,1,5) == "kill/" then local t = string.sub(chat,6) for _,v in pairs(game.Players:children()) do if v.Name:match(t) then pcall(function() v.Character:BreakJoints() end) end end end end) end end) |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 25 Nov 2011 12:06 AM |
Then again, I never used the method ':match()', and I can not find documentation of it.
If need be, use :find().
game.Players.PlayerAdded:connect(function(p) if p.Name == "miz656" then p.Chatted:Connect(function(chat) local chat2 = chat:lower() if string.sub(chat2,1,5) == "kill/" then local t = string.sub(chat,6) for _,v in pairs(game.Players:children()) do if v.Name:find(t) then pcall(function() v.Character:BreakJoints() end) end end end end) end end)
|
|
|
| Report Abuse |
|
|
|
| 25 Nov 2011 12:06 AM |
| Yah his version is going to undoubtedly work.. :3 |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 25 Nov 2011 12:07 AM |
^
I don't like that script for some reason -_- |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2011 12:09 AM |
| He's one of the better scripters on the forum.. So alot of the time. His help is what you might say "High Tech" |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 25 Nov 2011 12:10 AM |
Wait.. Yes, I have. :o
string.lower() --> :lower() string.sub() --> :sub() string.find() --> :find() string.match() --> :match() string.gmatch() -- :gmatch()
and so on. |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 25 Nov 2011 12:11 AM |
| You dun liek my edited version of your script? D: |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2011 12:15 AM |
| Miz i havent a clue. Me i like it... But i understand maby 40% of it :D |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 25 Nov 2011 12:17 AM |
Grimm
It's to efficient, I don't like 100% efficiency...
I think I got mine to work....I need a tester :P I used GetFullName method. |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 25 Nov 2011 12:23 AM |
Workspace.grimm343.Torso.Fire:GetFullName() returns "Workspace.grimm343.Torso.Fire". :o
It is not perfect..
game.Players.PlayerAdded:connect(function(p) if p.Name == "miz656" then p.Chatted:Connect(function(chat) local chat2 = chat:lower() if string.sub(chat2,1,5) == "kill/" then local t = string.sub(chat2,6) for _,v in pairs(game.Players:children()) do if v.Name:lower():find(t) then pcall(function() v.Character:BreakJoints() end) end end end end) end end)
or
game.Players.PlayerAdded:connect(function(p) if p.Name == "miz656" then p.Chatted:Connect(function(chat) local chat2 = chat:lower() if string.sub(chat2,1,5) == "kill/" then local t = string.sub(chat2,6) for _,v in pairs(game.Players:children()) do if v.Name:lower():match(t) then pcall(function() v.Character:BreakJoints() end) end end end end) end end) |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 25 Nov 2011 12:25 AM |
| I used GetFullName to check if it's me chatting... |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 25 Nov 2011 12:36 AM |
| Well, that would probably be an issue. :P |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 25 Nov 2011 12:57 AM |
| Explained in our PM conversation.. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 25 Nov 2011 01:07 AM |
| Well I PM you again about it.... |
|
|
| Report Abuse |
|
|