Can someone help me make the script for a radioactive lantern? [closed]
Asked by
8 years ago Edited 8 years ago
Ive used a find nearest torso script and edited it, but it wont do anything.
No output in the script analysis
01 | local larm = script.Parent:FindFirstChild( "Left Arm" ) |
02 | local rarm = script.Parent:FindFirstChild( "Right Arm" ) |
04 | function findNearestTorso(pos) |
05 | local list = game.Workspace:children() |
13 | if (temp 2. className = = "Model" ) and (temp 2 ~ = script.Parent) and game.Players:GetPlayerFromCharacter(temp 2 )~ = nil then |
14 | temp = temp 2 :findFirstChild( "Right Arm" ) |
15 | human = temp 2 :findFirstChild( "Humanoid" ) |
16 | if (temp ~ = nil ) and (human ~ = nil ) and (human.Health > 0 ) then |
17 | if (temp.Position - pos).magnitude < dist then |
19 | dist = (temp.Position - pos).magnitude |
32 | local target = findNearestTorso(script.Parent.Torso.Position) |