|
| 12 Feb 2014 12:37 AM |
It just displays a empty hint I cannot get any output from online mode since remote error won't work for me
hint = Instance.new("Hint") hint.Parent = Workspace hint.Name = "Hinty" Players = game.Players
repeat wait() Workspace.Hinty.Text = "Not Enough Players" until game.Players.NumPlayers >= 1 wait(1) hint.Text = "Enough Players!" wait(1) hint.Text = "Starting Game..." wait(2) local maps = game.Lighting.Maps:GetChildren() --Pick A random map Map = maps[math.random(1, #maps)] hint.Text = "Map Selected: "..Map.Name local players = game.Players:GetChildren() Killer = players[math.random(1, #players)] -- Pick a Killer
local Value = Instance.new("IntValue",Workspace) -- Make the Alive Value Value.Name = "Alive" Value.Value = game.Players.NumPlayers Value.Value = Value.Value +1
for _, v in pairs (game:GetService('Players'):GetPlayers()) do local Alive = Instance.new("BoolValue") Alive.Parent = v Alive.Value = true Alive.Name = "Alive" Killer.Alive:Destroy() wait(5) hint.Text = "" v.Character.Torso.CFrame = CFrame.new(10,10,10) wait(15) hint.Text = "The Killer has found a knife" -- Got knife game.Lighting.Knife:Clone().Parent = Killer.Backpack wait(3) hint.Text = "" local KillerHint = Instance.new("Hint",Killer.PlayerGui) KillerHint.Text = "You're the killer! Ambush the others when they least expect it" -- Message displayed to the killer wait(5) KillerHint:Destroy() character = v.Character game.Workspace.Timer.Value = true end
character:WaitForChild("Humanoid").Died:connect(function() local player = game.Players:GetPlayerFromCharacter(character) if player.Alive.Value == true then player.Alive.Value = false game.Workspace.Alive.Value = game.Workspace.Alive.Value - 1 end end)
repeat wait() until game.Workspace.Alive.Value == 0 or game.Workspace.Time.Value <1 local killed = Instance.new("Hint",Workspace) if game.Workspace.Time.Value <1 then killed.Text = "Time ran out! The Killer didn't kill everyone in time" killed.Text = "The Killer was "..Killer.Name.."!" print "Restarting Game" wait(1) game.Workspace.Tim.Disabled = true game.Workspace.Time.Value = 90 game.Workspace.Timer.Value = false v.Alive:Destroy() game.Workspace.Alive:Destroy() v.Character.Torso.CFrame = CFrame.new(10,10,10) Killer.Character.Humanoid.Health = 0 else if game.Workspace.Alive.Value <1 then killed.Text = "The Killer has killed everyone!" killed.Text = "The Killer was "..Killer.Name.."!" print "Restarting Game" wait(1) game.Workspace.Tim.Disabled = true game.Workspace.Time.Value = 90 game.Workspace.Timer.Value = false v.Alive:Destroy() game.Workspace.Alive:Destroy() v.Character.Torso.CFrame = CFrame.new(10,10,10) Killer.Character.Humanoid.Health = 0 end end
|
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 12 Feb 2014 12:59 AM |
Killer.Alive:Destroy()
Because it errors there. The first few text wont show because you havent joined yet. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 12 Feb 2014 01:49 AM |
Because Its In the For Loop And There Is Only 1 Killer And The Killer Only Has 1 Alive Value Yet You Are Trying To Destroy It Multiple Times. |
|
|
| Report Abuse |
|
|
|
| 12 Feb 2014 02:01 AM |
so how do I fix it?
its my first time using the for thing
is there another way to get all the players
|
|
|
| Report Abuse |
|
|
wubbzy301
|
  |
| Joined: 15 May 2010 |
| Total Posts: 1188 |
|
|
| 12 Feb 2014 02:15 AM |
You will need "if".
if Killer ~= nil then
end |
|
|
| Report Abuse |
|
|
| |
|
wubbzy301
|
  |
| Joined: 15 May 2010 |
| Total Posts: 1188 |
|
|
| 12 Feb 2014 02:34 AM |
| Between Alive.Name = "Alive" and wait(5) |
|
|
| Report Abuse |
|
|
wubbzy301
|
  |
| Joined: 15 May 2010 |
| Total Posts: 1188 |
|
| |
|
| |
|