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
 

Re: Kill Players doesnt function fine?

Previous Thread :: Next Thread 
planesoldier is not online. planesoldier
Joined: 26 Sep 2010
Total Posts: 533
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 is not online. 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
planesoldier is not online. planesoldier
Joined: 26 Sep 2010
Total Posts: 533
19 Jun 2014 10:58 AM
That is the code, im sorry, its not a function :S
Report Abuse
robomax11 is not online. 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
planesoldier is not online. planesoldier
Joined: 26 Sep 2010
Total Posts: 533
19 Jun 2014 11:07 AM
Still the same old problem ....
Report Abuse
robomax11 is not online. robomax11
Joined: 07 Jul 2011
Total Posts: 6828
19 Jun 2014 11:08 AM
show us the code

siggys r stupid
Report Abuse
planesoldier is not online. planesoldier
Joined: 26 Sep 2010
Total Posts: 533
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
SenseiWarrior is not online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
19 Jun 2014 11:15 AM
You dont need that coroutine
Report Abuse
planesoldier is not online. planesoldier
Joined: 26 Sep 2010
Total Posts: 533
19 Jun 2014 12:42 PM
Without courentine, still the same...
Report Abuse
Sprinted is not online. 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
planesoldier is not online. planesoldier
Joined: 26 Sep 2010
Total Posts: 533
19 Jun 2014 12:52 PM
AAAAAANNNDDDD... still the same thing....
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
19 Jun 2014 12:53 PM
can you show us when you're calling the function

Report Abuse
planesoldier is not online. planesoldier
Joined: 26 Sep 2010
Total Posts: 533
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
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
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
planesoldier is not online. planesoldier
Joined: 26 Sep 2010
Total Posts: 533
19 Jun 2014 12:59 PM
Ummmmm, yeh, its pretty useless xD. Not sure why i putted that in there...
Report Abuse
Aesthetical is online. Aesthetical
Joined: 01 Jan 2014
Total Posts: 2141
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
planesoldier is not online. planesoldier
Joined: 26 Sep 2010
Total Posts: 533
19 Jun 2014 01:02 PM
Doesnt that keep killing the players???
Report Abuse
SuperiorEternal is not online. SuperiorEternal
Joined: 22 Aug 2009
Total Posts: 2365
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
Aesthetical is online. Aesthetical
Joined: 01 Jan 2014
Total Posts: 2141
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
planesoldier is not online. planesoldier
Joined: 26 Sep 2010
Total Posts: 533
20 Jun 2014 08:15 AM
Guess what, it doesnt work again!!!! IM GETTING FCKING TIRED OF THIS SHT!
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
20 Jun 2014 08:22 AM
game.Players.PlayerAdde:connect(function(Player)
Player.CharacterAdded:connect(function(Character)
Character:BreakJoints()
end)
end)
Report Abuse
planesoldier is not online. planesoldier
Joined: 26 Sep 2010
Total Posts: 533
20 Jun 2014 08:22 AM
Sorry, its just really frustrating..
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
20 Jun 2014 08:25 AM
Yes, There is a typo in there.
No, I will not fix it for you.
Report Abuse
planesoldier is not online. planesoldier
Joined: 26 Sep 2010
Total Posts: 533
20 Jun 2014 08:27 AM
Yes, i found it
No, it doesnt work
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
20 Jun 2014 08:31 AM
Add some waiting time for the character then.
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