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.
01 | local Boss = game.Workspace:FindFirstChild( "TestMap" ) [ "Fake Santa" ] .Humanoid |
02 | local healthGui = script.Parent |
04 | local function round(n) |
05 | return math.floor(n + 0.5 ) |
08 | healthGui.Health.TextLabel.Text = round(Boss.Health) |
09 | Boss.Changed:Connect( function () |
10 | healthGui.Health.TextLabel.Text = round(Boss.Health) |
11 | local healthChange = Boss.Health/Boss.MaxHealth |
12 | healthGui.Health.Meter:TweenSize(UDim 2. new(healthChange, 0 , 1 , 0 ), "In" , "Linear" , 1 ) |