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

how do i make a gui appear once a boss dies?

basically I need help figuring out how to make a gui popup once the boss i made died.

Bacon.Humanoid.Died:Connect(function(khar)

end)

1 answer

Here is something that might work

local Workspace = game:GetService("Workspace")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

if Workspace.Bacon.Humanoid.Health == 0 then
	ReplicatedStorage.BossDefeated:FireClient(game.Players.LocalPlayer)  
end

-- NOTE: This is assuming the name of the boss is Bacon and it is in the Workspace.

Make sure that is a ServerScript, and you have a RemoteEvent named BossDefeated in ReplicatedStorage

Note: In StarterGui, created a ScreenGui that is named VictoryMessage, and put a TextLabel in it. You can decide the text, properties, etc.

Now, make this local script, and put it in StarterPlayer:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event = ReplicatedStorage:WaitForChild("BossDefeated")

Event.OnClientEvent:Connect(function(player)
script.Parent.Parent.PlayerGui.VictoryMessage.TextLabel.Visible = true
end)

--[[ I   suggest  going on the very beginning of line 5, then press tab. I   just moved it back so it  wouldn't go in the next line (in studio it won't go on the next line ]]--

I haven't tested this, tell me if it is not working, and if any errors appear in the output, tell me.

2 comments

0

hm it does not work even tho on line 5 the fireclient thing

0

I realized a mistake in both scripts. On the line that says local ReplicatedStorage, in the parentheses, I only put the starting quotation mark. Make sure you add the ending one.

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