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 » Scripters
Home Search
 

How to kill a character from a player.

Previous Thread :: Next Thread 
UnityAlex is not online. UnityAlex
Joined: 28 Jun 2011
Total Posts: 586
03 Jan 2015 02:08 PM
Hi! In my game, I'm making a GUI that is visible if the Seen value is true. That part works. But I'm also checking if the GUI is visible then wait 5 seconds and kill the player. Here is what I have:

while true do --Enter Loop
wait(1) --Help it not crash
if game.Workspace.Seen.Value == true then --Checks seen value
script.Parent.Visible = true -- Makes GUI visible
end -- closes if statement
--So far it works
if script.Parent.Visible == true then --Checks if gui is visible
wait(5) -- waits 5 seconds
script.Parent.Parent.Parent.Parent:Kill() --kills the player (this is what doesn't work)
end
end
Report Abuse
UnityAlex is not online. UnityAlex
Joined: 28 Jun 2011
Total Posts: 586
03 Jan 2015 02:09 PM
Yes I know the problem is Kill() but i don't know how to change it.
Report Abuse
DevUndead is not online. DevUndead
Joined: 24 Jul 2014
Total Posts: 558
03 Jan 2015 02:10 PM
Ol'eRightyThen.png

Script.Parent.Parent.Parent.Parent = nil

ಠ_ಠ
Report Abuse
UnityAlex is not online. UnityAlex
Joined: 28 Jun 2011
Total Posts: 586
03 Jan 2015 02:11 PM
Oh right *Facepalm

Thank you though
Report Abuse
UnityAlex is not online. UnityAlex
Joined: 28 Jun 2011
Total Posts: 586
03 Jan 2015 02:13 PM
Wait that doesn't work
Report Abuse
Josephsamson is not online. Josephsamson
Joined: 30 Oct 2012
Total Posts: 1421
03 Jan 2015 02:15 PM
try with no capital
Report Abuse
UnityAlex is not online. UnityAlex
Joined: 28 Jun 2011
Total Posts: 586
03 Jan 2015 02:15 PM
I did
Report Abuse
DevUndead is not online. DevUndead
Joined: 24 Jul 2014
Total Posts: 558
03 Jan 2015 02:16 PM
Try the :rekt() method. Sorry idk man
Report Abuse
iShinyCoil is not online. iShinyCoil
Joined: 03 Dec 2012
Total Posts: 165
03 Jan 2015 02:16 PM
@Joseph What are you on about?
Report Abuse
goro7 is not online. goro7
Joined: 01 Jul 2009
Total Posts: 735
03 Jan 2015 02:17 PM
Just set the players health to 0.
Report Abuse
UnityAlex is not online. UnityAlex
Joined: 28 Jun 2011
Total Posts: 586
03 Jan 2015 02:17 PM
C'mon guys is there like a way to find the character from the player?
Report Abuse
UnityAlex is not online. UnityAlex
Joined: 28 Jun 2011
Total Posts: 586
03 Jan 2015 02:18 PM
@goro the problem is I'm at the player root not the character root. Humanoid is not a child of player, but instead character.
Report Abuse
Josephsamson is not online. Josephsamson
Joined: 30 Oct 2012
Total Posts: 1421
03 Jan 2015 02:19 PM
what do you mean?
Report Abuse
goro7 is not online. goro7
Joined: 01 Jul 2009
Total Posts: 735
03 Jan 2015 02:20 PM
Unity, I mean this:

script.Parent.Parent.Parent.Parent.Character:WaitForChild("Humanoid").Health = 0
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
03 Jan 2015 02:20 PM
player.Character

logic is logical
Report Abuse
Josephsamson is not online. Josephsamson
Joined: 30 Oct 2012
Total Posts: 1421
03 Jan 2015 02:22 PM
he wants to kill the character? Isn't the character just all the player including the humanoid.
Report Abuse
UnityAlex is not online. UnityAlex
Joined: 28 Jun 2011
Total Posts: 586
03 Jan 2015 02:25 PM
Thank you so much! I'm oblivious that character is a property of player.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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