Answered by
4 years ago Edited 4 years ago
Here is something that might work
1 | local Workspace = game:GetService( "Workspace" ) |
2 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
4 | if Workspace.Bacon.Humanoid.Health = = 0 then |
5 | ReplicatedStorage.BossDefeated:FireClient(game.Players.LocalPlayer) |
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:
1 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
2 | local Event = ReplicatedStorage:WaitForChild( "BossDefeated" ) |
4 | Event.OnClientEvent:Connect( function (player) |
5 | script.Parent.Parent.PlayerGui.VictoryMessage.TextLabel.Visible = true |
I haven't tested this, tell me if it is not working, and if any errors appear in the output, tell me.