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: Why dosen't this script work in play mode?

Previous Thread :: Next Thread 
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
05 Oct 2013 11:02 AM
It only kills you in solo mode, it don't work on play mode. As you can see when the message is 0 it should kill.



local h = Instance.new("Hint", workspace);
local m = Instance.new("Message", workspace);

local changeHint = coroutine.wrap(function()
for i = 60, 0, -1 do
wait(0.5)
h.Text = i

end
end)
local changeMessage = coroutine.wrap(function()
local Player = game.Players:GetChildren()
for i = 60, 0, -1 do
wait(1)
m.Text = i
if i == 0 then
for x = 1,#Player,1 do
Player[x].Character.Humanoid.Health = 0
end

end


end
end)

changeHint()
changeMessage()
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
05 Oct 2013 11:05 AM
Help.
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
05 Oct 2013 11:09 AM
Ples, just help....
Report Abuse
Dexatio is not online. Dexatio
Joined: 08 Oct 2011
Total Posts: 260
05 Oct 2013 11:10 AM
Is it in a local script?

- Dex
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
05 Oct 2013 11:11 AM
No, it's not in a localscript!
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
05 Oct 2013 11:16 AM
My gawch! HELP!
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
05 Oct 2013 11:19 AM
Help.
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
05 Oct 2013 11:35 AM
Halp...
Report Abuse
juzzbyXfalcon is not online. juzzbyXfalcon
Joined: 02 Feb 2011
Total Posts: 1311
05 Oct 2013 11:41 AM
Let me redo that. Think this should work, didn't test it though.

local h = Instance.new("Hint", game.Workspace)
local m = Instance.new("Message", game.Workspace)

coroutine.resume(coroutine.create(function()
for i = 60,1,-1 do
wait(1)
h.Text = i
end
end))

for i = 1,60 do
wait(1)
m.Text = i
end

for _,v in pairs game.Players:GetChildren() do
v.Character:BreakJoints()
end


-Believe and you will achieve-
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
05 Oct 2013 12:48 PM
uhm... That doesn't work.
Report Abuse
juzzbyXfalcon is not online. juzzbyXfalcon
Joined: 02 Feb 2011
Total Posts: 1311
05 Oct 2013 12:49 PM
So you expect me to magically know what was wrong with it?

-Believe and you will achieve-
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
05 Oct 2013 12:54 PM
I didn't ask you, think before you talk.
Report Abuse
juzzbyXfalcon is not online. juzzbyXfalcon
Joined: 02 Feb 2011
Total Posts: 1311
05 Oct 2013 12:56 PM
Good, because I found what was wrong with it.

local h = Instance.new("Hint", game.Workspace)
local m = Instance.new("Message", game.Workspace)

coroutine.resume(coroutine.create(function()
for i = 60,1,-1 do
wait(1)
h.Text = i
end
end))

for i = 1,60 do
wait(1)
m.Text = i
end

for _,v in pairs (game.Players:GetChildren()) do
v.Character:BreakJoints()
end

-Believe and you will achieve-
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
05 Oct 2013 12:59 PM
Why would you use coroutine.resume? instead of just doing what I did?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
05 Oct 2013 01:00 PM
local h = Instance.new("Hint", game.Workspace)
local m = Instance.new("Message", game.Workspace)

for i = 60,1,-1 do
wait(1)
h.Text = i
m.Text = i
end

for _,v in pairs (game.Players:GetChildren()) do
v.Character:BreakJoints()
end
Report Abuse
juzzbyXfalcon is not online. juzzbyXfalcon
Joined: 02 Feb 2011
Total Posts: 1311
05 Oct 2013 01:07 PM
Because one counts up and the other goes down? Didn't the OP use a coroutine anyway. Aren't you the OP?

-Believe and you will achieve-
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