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: Load kill script

Previous Thread :: Next Thread 
geckohero17 is not online. geckohero17
Joined: 27 Dec 2009
Total Posts: 1342
23 Aug 2013 01:07 PM
for j, v in pairs(game.Players:GetPlayers()) do
pcall(function()
v.Character.Torso:remove()
end)
end
script.Parent:remove()

Basically it removes your Torso once on entering.
Problem is that it only works in test mode.
Report Abuse
RaceToTheBottom is not online. RaceToTheBottom
Joined: 27 Jul 2013
Total Posts: 169
23 Aug 2013 01:09 PM
[ Content Deleted ]
Report Abuse
geckohero17 is not online. geckohero17
Joined: 27 Dec 2009
Total Posts: 1342
24 Aug 2013 06:08 AM
Didn't work.
Report Abuse
sycips is not online. sycips
Joined: 21 Mar 2011
Total Posts: 1368
24 Aug 2013 06:21 AM
You already said it yourself:'On Entered'. That means that you'll need the event .PlayerAdded! I will give you the script, if you want to make upgrades to the script, you can do that yourself:

Game.Players.PlayerAdded:connect(function(player) --keep in mind that the event .PlayerAdded doesn't work in solo mode! Try using it by starting a server or putting it online!
player.CharacterAdded:wait() --waits for the character to be loaded
local torso = player.Character:WaitForChild("Torso")--waits for the torso to be a member of the character (just to make sure that the script won't crash)
torso:remove() -- parents the torso to nil, you could also use :Destroy() if you like that better...
end)

btw, I don't really understand why you remove the torso... Do you want to kill the player when it joins? because then you could also make it's health 0 or break all it's joints...
Report Abuse
geckohero17 is not online. geckohero17
Joined: 27 Dec 2009
Total Posts: 1342
24 Aug 2013 08:20 AM
It's just so that the player loads a little better.
Plus, there's a glitch sometimes when they move off the spawn.
Report Abuse
geckohero17 is not online. geckohero17
Joined: 27 Dec 2009
Total Posts: 1342
24 Aug 2013 08:32 AM
Is this better..?
(I'm not very good with this kind of scripting)

Game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:wait()
local Humanoid = player.Character:WaitForChild("Humanoid")
Humanoid.Health = 0
end)
script.Parent:Destroy()
Report Abuse
geckohero17 is not online. geckohero17
Joined: 27 Dec 2009
Total Posts: 1342
24 Aug 2013 08:37 AM
Well that's interesting.
I got it to work better than I wanted it to.
Report Abuse
geckohero17 is not online. geckohero17
Joined: 27 Dec 2009
Total Posts: 1342
24 Aug 2013 08:39 AM
Nevermind... It's crashing...
Report Abuse
geckohero17 is not online. geckohero17
Joined: 27 Dec 2009
Total Posts: 1342
24 Aug 2013 08:46 AM
Nevermind, fixed. Closed. Done. :P
Report Abuse
sycips is not online. sycips
Joined: 21 Mar 2011
Total Posts: 1368
24 Aug 2013 09:44 AM
Haha, good that you fixed it yourself :)
Report Abuse
geckohero17 is not online. geckohero17
Joined: 27 Dec 2009
Total Posts: 1342
24 Aug 2013 10:54 AM
:)
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