generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: My script wont do anything

Previous Thread :: Next Thread 
captinsoap is not online. captinsoap
Joined: 24 Jan 2010
Total Posts: 9570
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 is not online. 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
captinsoap is not online. captinsoap
Joined: 24 Jan 2010
Total Posts: 9570
12 Feb 2014 01:16 AM
why does it error?





Report Abuse
captinsoap is not online. captinsoap
Joined: 24 Jan 2010
Total Posts: 9570
12 Feb 2014 01:35 AM
b1





Report Abuse
captinsoap is not online. captinsoap
Joined: 24 Jan 2010
Total Posts: 9570
12 Feb 2014 01:46 AM
b2





Report Abuse
wazap is not online. 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
captinsoap is not online. captinsoap
Joined: 24 Jan 2010
Total Posts: 9570
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 is not online. 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
captinsoap is not online. captinsoap
Joined: 24 Jan 2010
Total Posts: 9570
12 Feb 2014 02:23 AM
where?
Report Abuse
wubbzy301 is not online. wubbzy301
Joined: 15 May 2010
Total Posts: 1188
12 Feb 2014 02:34 AM
Between Alive.Name = "Alive" and wait(5)
Report Abuse
wubbzy301 is not online. wubbzy301
Joined: 15 May 2010
Total Posts: 1188
12 Feb 2014 02:34 AM
Idk ignore this.
Report Abuse
captinsoap is not online. captinsoap
Joined: 24 Jan 2010
Total Posts: 9570
12 Feb 2014 02:46 AM
can anyone fix it?





Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image