|
| 31 Jul 2017 11:21 AM |
| Ive Been trying for hours, is this even possible? And if so, please help. Im A New developer and in need of this help. |
|
|
| Report Abuse |
|
|
| |
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 31 Jul 2017 11:26 AM |
| Are you trying to make a recursive function? |
|
|
| Report Abuse |
|
|
|
| 31 Jul 2017 11:37 AM |
local KillTouch = script.Parent
local function PlayerTouched(Part) local Parent = Part.Parent if game.Players:GetPlayerFromCharacter(Parent) then Parent.Humanoid.Health = 0 end end
KillTouch.Touched:connect(PlayerTouched) |
|
|
| Report Abuse |
|
|
|
| 31 Jul 2017 01:51 PM |
| Im Trying to make a while true do script kill a player when touching a specific brick and the value is true, the value name is Kill |
|
|
| Report Abuse |
|
|
|
| 31 Jul 2017 01:52 PM |
| And it's not a local script, just a script. |
|
|
| Report Abuse |
|
|
Mitko0o1
|
  |
| Joined: 30 Nov 2010 |
| Total Posts: 5725 |
|
|
| 31 Jul 2017 01:53 PM |
You have events for this reason, no need of while loop. Place Vinny's script inside the part you want and try it.
|
|
|
| Report Abuse |
|
|
| |
|
|
| 31 Jul 2017 02:31 PM |
| Just tried it, it doesn't work for what I'm doing. Im Planning on making a script that on the touch of the script's parent (Which is a brick), It would kill them if the value named "Kill" is true. Thanks in advance. |
|
|
| Report Abuse |
|
|
Rinem
|
  |
| Joined: 05 Jan 2014 |
| Total Posts: 255 |
|
|
| 31 Jul 2017 02:34 PM |
local KillTouch = script.Parent
local function PlayerTouched(Part) local Parent = Part.Parent if game.Players:GetPlayerFromCharacter(Parent) and kill == true then --//change 'kill' to whatever your value is Parent.Humanoid.Health = 0 end end
KillTouch.Touched:connect(PlayerTouched)
dabbin' on the haters |
|
|
| Report Abuse |
|
|
| |
|
|
| 31 Jul 2017 02:40 PM |
| It Still didn't work! UGHHHHHHHHHHHHHH! I Need it to kill when the value is true, and the value name is "Kill" |
|
|
| Report Abuse |
|
|
| |
|
Sweegz
|
  |
| Joined: 08 Apr 2013 |
| Total Posts: 519 |
|
|
| 01 Aug 2017 03:42 PM |
Just add && if value == true
|
|
|
| Report Abuse |
|
|