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

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

Asked by 3 years ago
Edited 3 years ago

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

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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.

0
hm it does not work even tho on line 5 the fireclient thing justdontknowit 0 — 3y
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. cookie_more 30 — 3y
Ad

Answer this question