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.

01local Boss = game.Workspace:FindFirstChild("TestMap")["Fake Santa"].Humanoid
02local healthGui = script.Parent
03 
04local function round(n)
05    return math.floor(n + 0.5)
06end
07 
08healthGui.Health.TextLabel.Text = round(Boss.Health)
09Boss.Changed:Connect(function()
10    healthGui.Health.TextLabel.Text = round(Boss.Health)
11    local healthChange = Boss.Health/Boss.MaxHealth
12    healthGui.Health.Meter:TweenSize(UDim2.new(healthChange,0,1,0),"In","Linear",1)
13end)

1 answer

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

Answer this question