Hello, I am currently making a game in which players are put in this map where they have to kill an AI character. So far, I have everything finished for the scripts except when the players kill the NPC and the game ends. I don't have a very well knowledge of this, and I really need this help to upload the game. To be exact, I need a continuation of this script (in the post) that will end the round(say something like "Player2 has killed the Murderer" as well) when a player kills the NPC, and after, all players will be taken to the lobby(spawnlocation pad). Please reply as soon as you can.
This is the script so far:
local replicatedstorage = game:GetService("ReplicatedStorage") local status = replicatedstorage:WaitForChild("StatusValue")
while true do -- Intermission for i = 30,0,-1 do status.Value = "Intermission: "..i wait(1) end status.Value = "Game in progress" local map = game.ServerStorage.BaseMap map:Clone().Parent = game.Workspace wait(15) game.Workspace.BaseMap:Destroy() status.Value = "Game Over!" end
If there are any issues with this script, please be sure to comment on it as well. Thank you!

5 comments
USE A CODE BLOCK.png
Please put the code in a code block, by selecting all the code and clicking the lua icon.
Oh sorry, but still it would be appreciated if I could have an answer to my question.
You could add a script in the AI character that detects when he's been killed using the Humanoid's Died() detection.
im not very knowledgeable in scripting. Can u reccomend me a script?