|
| 19 Jun 2014 10:57 AM |
Hey There!
I have a Kill function in one of my scripts, and it works fine the first time, but it doesnt the next times. This is my script:
for i,v in pairs(game.Players:GetChildren()) do v.Character:BreakJoints() end
So it only works once. Any help :D?
THX! Planesoldier |
|
|
| Report Abuse |
|
|
robomax11
|
  |
| Joined: 07 Jul 2011 |
| Total Posts: 6828 |
|
|
| 19 Jun 2014 10:57 AM |
thats becus its not in a function. gives us the code
siggys r stupid |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2014 10:58 AM |
| That is the code, im sorry, its not a function :S |
|
|
| Report Abuse |
|
|
robomax11
|
  |
| Joined: 07 Jul 2011 |
| Total Posts: 6828 |
|
|
| 19 Jun 2014 11:01 AM |
if thats the code it'll only run once. make it a function then call the function to run it again
function killallp() for i, v in pairs(game.Players:GetPlayers()) do coroutine.resume(coroutine.create(function() v.Character:BreakJoints() end)) end end
then call it
killallp()
siggys r stupid |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2014 11:07 AM |
| Still the same old problem .... |
|
|
| Report Abuse |
|
|
robomax11
|
  |
| Joined: 07 Jul 2011 |
| Total Posts: 6828 |
|
|
| 19 Jun 2014 11:08 AM |
show us the code
siggys r stupid |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2014 11:10 AM |
Probably made a d@mb mistake...
function killallp() for i, v in pairs(game.Players:GetPlayers()) do coroutine.resume(coroutine.create(function() v.Character:BreakJoints() end)) end end wait(0.1) killallp() wait(0.1) |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2014 11:15 AM |
| You dont need that coroutine |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2014 12:42 PM |
| Without courentine, still the same... |
|
|
| Report Abuse |
|
|
Sprinted
|
  |
| Joined: 17 Apr 2013 |
| Total Posts: 89 |
|
|
| 19 Jun 2014 12:43 PM |
function killplayers() for i,v in pairs(game.Players:GetChildren()) do if v.Character then v.Character:BreakJoints() end end end killplayers() --enjoy |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2014 12:52 PM |
| AAAAAANNNDDDD... still the same thing.... |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2014 12:53 PM |
can you show us when you're calling the function
|
|
|
| Report Abuse |
|
|
|
| 19 Jun 2014 12:57 PM |
This is it from the Begin to the Call:
while true do wait(5) local m = math.random(1,1) if m == 1 then wait(1) function killplayers() for i,v in pairs(game.Players:GetChildren()) do if v.Character then v.Character:BreakJoints() end end end killplayers() wait(0.1) |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2014 12:58 PM |
well firstly, wtf is this point in this
"local m = math.random(1,1) if m == 1 then"
|
|
|
| Report Abuse |
|
|
|
| 19 Jun 2014 12:59 PM |
| Ummmmm, yeh, its pretty useless xD. Not sure why i putted that in there... |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2014 01:01 PM |
function killer() for i,v in pairs(game.Players:GetChildren()) do v.Character:BreakJoints() end end
while true do killer() wait(7) end |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2014 01:02 PM |
| Doesnt that keep killing the players??? |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2014 01:04 PM |
repeat wait() until game.Players.LocalPlayer.Character:BreakJoints() game.Players.LocalPlayer.Character:BreakJoints()
I recommend putting that in a Local Script in the StarterPack |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2014 01:05 PM |
function killer() for i,v in pairs(game.Players:GetChildren()) do v.Character:BreakJoints() end end
--Now, connect the function with any event as you wish. |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2014 08:15 AM |
| Guess what, it doesnt work again!!!! IM GETTING FCKING TIRED OF THIS SHT! |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2014 08:22 AM |
game.Players.PlayerAdde:connect(function(Player) Player.CharacterAdded:connect(function(Character) Character:BreakJoints() end) end) |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2014 08:22 AM |
| Sorry, its just really frustrating.. |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2014 08:25 AM |
Yes, There is a typo in there. No, I will not fix it for you. |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2014 08:27 AM |
Yes, i found it No, it doesnt work |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2014 08:31 AM |
| Add some waiting time for the character then. |
|
|
| Report Abuse |
|
|