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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 28 Jun 2011 |
| Total Posts: 586 |
|
|
| 03 Jan 2015 02:11 PM |
Oh right *Facepalm
Thank you though |
|
|
| Report Abuse |
|
|
UnityAlex
|
  |
| Joined: 28 Jun 2011 |
| Total Posts: 586 |
|
| |
|
| |
|
UnityAlex
|
  |
| Joined: 28 Jun 2011 |
| Total Posts: 586 |
|
| |
|
DevUndead
|
  |
| Joined: 24 Jul 2014 |
| Total Posts: 558 |
|
|
| 03 Jan 2015 02:16 PM |
| Try the :rekt() method. Sorry idk man |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2015 02:16 PM |
| @Joseph What are you on about? |
|
|
| Report Abuse |
|
|
goro7
|
  |
| Joined: 01 Jul 2009 |
| Total Posts: 735 |
|
|
| 03 Jan 2015 02:17 PM |
| Just set the players health to 0. |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
| |
|
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 |
|
|
|
| 03 Jan 2015 02:20 PM |
player.Character
logic is logical |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|