|
| 07 Jun 2015 12:40 PM |
So I made a simple tycoon.
Let's say I (BlixBlocker) own a tycoon. Another person (Shedletsky) walks into my tycoon via door.
He is supposed to die, but he doesn't.
My script: local player = game.Players.LocalPlayer local character = player.Character local humanoid = character.Humanoid
while wait() do script.Parent.Head.Touched:connect(function(hit) if hit.Name ~= script.Parent.Parent.Parent.Owner.Value then hit.Humanoid.Health = 0 end end) end
this script is inside of a part named "Head" |
|
|
| Report Abuse |
|
|
|
| 07 Jun 2015 12:41 PM |
remove the loop wow really? |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 07 Jun 2015 12:59 PM |
I'm going to debug your logic errors, but it still may not work without some tweaking.
local Players = game:GetService("Players")
script.Parent.Touched:connect(function(hit) local character = hit.Parent if Players:GetPlayerFromCharacter(character) then if character.Name ~= script.Parent.Parent.Parent.Owner.Value then character.Humanoid.Health = 0 end end end)
--
That probably didn't fix your code entirely, to do that, you need to tell us what's going on. What are you checking and why is this in a local script? |
|
|
| Report Abuse |
|
|