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

How do I find the boss humanoid when cloned? {SOLVED}

Asked by 4 years ago
Edited 4 years ago

So I thought it was simple to make but it's not. How do I make this script grab this boss humanoid?

PLEASE READ The game clones the boss which puts them into the workspace. The problem is that I cant seem to make the script detect if the map exists. If I can find out how to make it know that the map exists then the rest will be a cake walk.

local Boss = game.Workspace:FindFirstChild("TestMap")["Fake Santa"].Humanoid
local healthGui = script.Parent

local function round(n)
    return math.floor(n + 0.5)
end 

healthGui.Health.TextLabel.Text = round(Boss.Health)
Boss.Changed:Connect(function()
    healthGui.Health.TextLabel.Text = round(Boss.Health)
    local healthChange = Boss.Health/Boss.MaxHealth
    healthGui.Health.Meter:TweenSize(UDim2.new(healthChange,0,1,0),"In","Linear",1)
end)

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago
Answer: local Boss = game.Workspace:WaitForChild("TestMap")["Fake Santa"].Humanoid
Ad

Answer this question