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

What's wrong with my simple Victory gui script after I kill the boss?

Asked by 3 years ago

This script is supposed to make a gui appear once a boss is defeated, but nothing happens when it dies. I don't get what's wrong, its a simple script.

if game.Workspace.Obama.Humanoid.Health == 0 then
    script.Parent.Visible = true
end
0
Can you pleaes send more Information like File Path etc. Ferrarimami 120 — 3y
0
Its a local script inside a text label inside of starter gui. Is that enough info? surviarlTheJefkillre 55 — 3y
0
You have to put the Text Label into a ScreenGUI, not just in the StarterGUI Folder. Ferrarimami 120 — 3y
0
i did surviarlTheJefkillre 55 — 3y
View all comments (6 more)
0
Take a picture of the explorer Cyrus_O4 45 — 3y
0
what do you think im stupid surviarlTheJefkillre 55 — 3y
0
OK. Is everything probably linked? Like, is the Humanoid under the Obama Object? Or inside of another Object in Obama for example? Ferrarimami 120 — 3y
0
Or is the ScreenGUI enabled, if not, it can't show it's children anyway Ferrarimami 120 — 3y
0
its all linked and ive double checked multiple times. surviarlTheJefkillre 55 — 3y
0
k Ferrarimami 120 — 3y

2 answers

Log in to vote
0
Answered by 3 years ago
if game:GetService("Workspace"):WaitForChild("Obama").Humanoid.Health < 1 then
script.Parent.Visible = true
end
--[[
The code's firing as soon as you play. but your character is still loading in, above. Im waiting for the character.
]]
Ad
Log in to vote
0
Answered by
FirezDevv 162
3 years ago

That is fired when the script starts running, this is a loop and it will continue running forever(well until the player leaves)

while wait() do
if game.Workspace.Obama.Humanoid.Health == 0 then
        script.Parent.Visible = true
    end
end

Answer this question