Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

10 comments

0

Can you pleaes send more Information like File Path etc.

0

Its a local script inside a text label inside of starter gui. Is that enough info?

0

You have to put the Text Label into a ScreenGUI, not just in the StarterGUI Folder.

0

i did

0

Take a picture of the explorer

0

what do you think im stupid

0

OK. Is everything probably linked? Like, is the Humanoid under the Obama Object? Or inside of another Object in Obama for example?

0

Or is the ScreenGUI enabled, if not, it can't show it's children anyway

0

its all linked and ive double checked multiple times.

0

k

2 answers

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.
]]

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

This discussion is preserved as it was. New answers, comments, and votes are closed.