|
| 07 Oct 2012 05:15 PM |
local easypeople = {} local on = false script.Parent.Touched:connect((function(hit) if hit.Parent:findFirstChild("Humanoid") then if not on then on = true table.insert(easypeople, hit.Parent.Name) game.Workspace.easything.easyisrunning.Value = false if game.Workspace.easything.easyisrunning.Value == false then wait(10) game.Workspace.Beginner.Head.BrickColor = BrickColor.new("Bright red") for i, b in pairs(easypeople) do for i,v in pairs(game.Players:GetChildren()) do if v.Name == b then local player = game.Players:findFirstChild(b) player.Character.Torso.CFrame = CFrame.new(18.1,30,181.4) game.Workspace.easything.easyisrunning.Value = true if game.Workspace.easything.easyisrunning.Value == true then game.Workspace.w.CanCollide = true end end end end end on = false end end end))
The problem is that I need it so when one person touches it, it waits 10 seconds then any other people who touched the brick during that 10 seconds will be teleported at the same time as the first person who touched it.
Would I use a coroutine?
~xXTheRobotXx |
|
|
| Report Abuse |
|
|
| |
|
|
| 07 Oct 2012 05:34 PM |
oh gosh. Do I have to? Oh well :L
local easypeople = {} local on = false script.Parent.Touched:connect(function(hit) if hit.Parent:findFirstChild("Humanoid") then if not on then on = true table.insert(easypeople, hit.Parent.Name) if game.Workspace.easything.easyisrunning.Value ~= false then game.Workspace.easything.easyisrunning.Value = false end end end end)
if not game.Workspace.easything.easyisrunning then wait(10) game.Workspace.Beginner.Head.BrickColor = BrickColor.new("Bright red") for _,b in pairs(easypeople) do for _,v in pairs(game.Players:GetChildren()) do if v.Name == b then local player = game.Workspace:findFirstChild(b) player:MoveTo(Vector3.new(18.1, 30, 181.4) game.Workspace.easything.easyisrunning.Value = true game.Workspace.w.CanCollide = true end end end end
|
|
|
| Report Abuse |
|
|
| |
|
LV1Z
|
  |
| Joined: 23 Jul 2011 |
| Total Posts: 652 |
|
|
| 07 Oct 2012 05:55 PM |
local easypeople = {} local ting = 1 script.Parent.Touched:connect((function(hit) if hit.Parent:findFirstChild("Humanoid") then if ting == 1 then ting = 0 table.insert(easypeople, hit.Parent.Name) game.Workspace.easything.easyisrunning.Value = false if game.Workspace.easything.easyisrunning.Value == false then game.Workspace.Beginner.Head.BrickColor = BrickColor.new("Bright red") for i, b in pairs(easypeople) do for i,v in pairs(game.Players:GetChildren()) do if v.Name == b then local player = game.Players:findFirstChild(b) player.Character.Torso.CFrame = CFrame.new(18.1,30,181.4) game.Workspace.easything.easyisrunning.Value = true if game.Workspace.easything.easyisrunning.Value == true then game.Workspace.w.CanCollide = true wait(10) end end end end end ting = 1 end end end)) |
|
|
| Report Abuse |
|
|
|
| 07 Oct 2012 06:09 PM |
| http://wiki.roblox.com/index.php/Beginners_Guide_to_Coroutines |
|
|
| Report Abuse |
|
|
|
| 07 Oct 2012 06:18 PM |
Please, someone help me
~xXTheRobotXx |
|
|
| Report Abuse |
|
|
|
| 07 Oct 2012 06:29 PM |
I tried using a coroutine, but this is failing
newplayer = coroutine.create(function(lol) local easypeople = {} local ting = 1 script.Parent.Touched:connect(function(hit) if hit.Parent:findFirstChild("Humanoid") then if ting == 1 then ting = 0 table.insert(easypeople, hit.Parent.Name) game.Workspace.easything.easyisrunning.Value = false if game.Workspace.easything.easyisrunning.Value == false then coroutine.resume(lol) wait(5) lol() game.Workspace.Beginner.Head.BrickColor = BrickColor.new("Bright red") for i, b in pairs(easypeople) do for i,v in pairs(game.Players:GetChildren()) do if v.Name == b then local player = game.Players:findFirstChild(b) player.Character.Torso.CFrame = CFrame.new(18.1,30,181.4) game.Workspace.easything.easyisrunning.Value = true if game.Workspace.easything.easyisrunning.Value == true then game.Workspace.w.CanCollide = true end end end end end ting = 1 end end end) end)
Can anyone please fix this?
~xXTheRobotXx |
|
|
| Report Abuse |
|
|
|
| 07 Oct 2012 06:50 PM |
bump
PLEASE SOMEONE, I REALLY NEED THIS
~xXTheRobotXx |
|
|
| Report Abuse |
|
|