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: I really need help with this

Previous Thread :: Next Thread 
Machination is not online. Machination
Joined: 04 Sep 2012
Total Posts: 327
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
Machination is not online. Machination
Joined: 04 Sep 2012
Total Posts: 327
07 Oct 2012 05:26 PM
bump :/

~xXTheRobotXx
Report Abuse
blackboy167thst is not online. blackboy167thst
Joined: 22 Jul 2011
Total Posts: 2468
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
Machination is not online. Machination
Joined: 04 Sep 2012
Total Posts: 327
07 Oct 2012 05:50 PM
Nope.

~xXTheRobotXx
Report Abuse
LV1Z is not online. 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
blackboy167thst is not online. blackboy167thst
Joined: 22 Jul 2011
Total Posts: 2468
07 Oct 2012 06:09 PM
http://wiki.roblox.com/index.php/Beginners_Guide_to_Coroutines
Report Abuse
Machination is not online. Machination
Joined: 04 Sep 2012
Total Posts: 327
07 Oct 2012 06:18 PM
Please, someone help me

~xXTheRobotXx
Report Abuse
Machination is not online. Machination
Joined: 04 Sep 2012
Total Posts: 327
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
Machination is not online. Machination
Joined: 04 Sep 2012
Total Posts: 327
07 Oct 2012 06:50 PM
bump

PLEASE SOMEONE, I REALLY NEED THIS

~xXTheRobotXx
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