Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can someone help me make the script for a radioactive lantern? [closed]

Asked by 7 years ago
Edited 7 years ago

Ive used a find nearest torso script and edited it, but it wont do anything. No output in the script analysis

local larm = script.Parent:FindFirstChild("Left Arm")
local rarm = script.Parent:FindFirstChild("Right Arm")
local human = nil
function findNearestTorso(pos)
    local list = game.Workspace:children()
    local torso = nil
    local dist = 30
    local temp = nil

    local temp2 = nil
    for x = 1, #list do
        temp2 = list[x]
        if (temp2.className == "Model") and (temp2 ~= script.Parent) and game.Players:GetPlayerFromCharacter(temp2)~=nil then
            temp = temp2:findFirstChild("Right Arm")
            human = temp2:findFirstChild("Humanoid")
            if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
                if (temp.Position - pos).magnitude < dist then
                    torso = temp
                    dist = (temp.Position - pos).magnitude
                end
            end
        end
    end
    return torso
end




while true do
    wait()
    local target = findNearestTorso(script.Parent.Torso.Position)
    if target ~= nil then
        human:TakeDamage(10)
    end

end

0
Can you post the script pls in a code block. User#5423 17 — 7y
0
Heh free model script. seen this before. RubenKan 3615 — 7y
0
lol Bombsboom 0 — 7y
0
from a rpg kit Bombsboom 0 — 7y
View all comments (3 more)
0
What's it do? How is that different from what it's supposed to do? BlueTaslem 18071 — 7y
0
Not enough information. AstrealDev 728 — 7y
0
Dont ask us to make a free model work for you. You wouldnt even understand what all of this does.. RubenKan 3615 — 7y

Closed as Non-Descriptive by iluvmaths1123 and BlueTaslem

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?