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!
~~~~~~~~~~~~~~~~~
T = workspace.NPC <pre class="brush: lua">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) if T.Humanoid.Health > 0 then T:new(‘IntValue’).value = “Alive” wait(0.2) While true do wait(0) else game.Workspace.BaseMap:Destroy() status.Value = "Game Over!" end
</pre>
~~~~~~~~~~~~~~~~~i dont know if this is right so just idk try to do stuff with this??