Hi there, I am making a story game like Camping or Airplane, and if you played, you would know that a random player gets sick. In Camping, you die, but in Airplane, you have a chance to live. I want to go with the Airplane option where once you are poisoned, you can touch or click a med-kit, and it will save that random character, but if not in time, they die. I'm fine with the Camping option, and I made a script. Here it is:
local dialogue = game.ReplicatedStorage.Dialogue local type = Enum.ThumbnailType.HeadShot local size = Enum.ThumbnailSize.Size180x180 function Message(player, speech, id) dialogue:FireAllClients(player, speech, id) end wait(0.1) local players = game.Players:GetChildren() local dead = players[math.random(1, #players)] local id = game.Players:GetUserThumbnailAsync(player.UserId, type, size) Message(player, "I don't feel good...", id) dead.Character.HumanoidRootPart.CFrame = CFrame.new(workspace.KillBrick.Position) end)
It isn't a local script, and the "end" at the end has an error. Please help, and thank you!
Never mind! I came up with it by myself!
local dialogue = game.ReplicatedStorage.Dialogue local type = Enum.ThumbnailType.HeadShot local size = Enum.ThumbnailSize.Size180x180 function Message(player, speech, id) dialogue:FireAllClients(player, speech, id) end wait(4) local players = game.Players:GetChildren() local dead = players[math.random(1, #players)] local id = game.Players:GetUserThumbnailAsync(dead.UserId, type, size) Message(dead, "Oh no, I'm allergic to garlic!", id) wait(2) dead.Character:MoveTo(Vector3.new(-349.28, 0.5, 83.68))