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: Door Help

Previous Thread :: Next Thread 
Cizox is not online. Cizox
Joined: 25 Dec 2009
Total Posts: 42220
23 Nov 2013 01:41 PM
Well, what this is supposed to do:

When a player touches a brick, two doors begin to open at the same time, thus having to use a coroutine. Then after 5 seconds, the doors close once again at the same time.

Problem:
When I step on the brick, nothing happens. I'm fairly new to coroutines so that may be the problem. I tried it before without coroutines, and they basically open and close one at a time, but I want them to open both at the same time. Once again, no output.

SCRIPT:
leftDoor = script.Parent.Parent.LeftDoor
rightDoor = script.Parent.Parent.RightDoor

debounce = false

function openDoor(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
if (debounce == false) then
debounce = true
wait(0.5)
local openLeft = coroutine.wrap(function()
for i = -0.972, -6.972, -.100 do
wait()
leftDoor.CFrame = CFrame.new(i, 0.63, -14.453)
end end)
local openRight = coroutine.wrap(function()
for n = 5.156, 11.156, .100 do
wait()
rightDoor.CFrame = CFrame.new(n, 0.63, -14.445)
end end)
wait(4)
local closeLeft = coroutine.wrap(function()
for x = -6.972, -0.972, .100 do
wait()
leftDoor.CFrame = CFrame.new(x, 0.63, -14.453)
end end)
local closeRight = coroutine.wrap(function()
for v = 11.156, 5.156, -.100 do
wait()
rightDoor.CFrame = CFrame.new(v, 0.63, -14.445)
end end)
end
end
end

debounce = false

script.Parent.Touched:connect(openDoor)

Any help?
Report Abuse
Cizox is not online. Cizox
Joined: 25 Dec 2009
Total Posts: 42220
23 Nov 2013 01:48 PM
Bump.
Report Abuse
GiganticGulian is not online. GiganticGulian
Joined: 18 Feb 2011
Total Posts: 2233
23 Nov 2013 01:49 PM
Dog goes woof
Cat goes meow
Bird goes tweet
and mouse goes squeek

Cow goes moo
Frog goes croak
and the elephant goes toot

Ducks say quack
and fish go blub
and the seal goes ow ow ow

But theres one sound
That no one knows
What does the output says?
Report Abuse
Greendolph is not online. Greendolph
Joined: 07 May 2008
Total Posts: 2543
23 Nov 2013 01:50 PM
^ This :D
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
23 Nov 2013 01:50 PM
lol
Report Abuse
Greendolph is not online. Greendolph
Joined: 07 May 2008
Total Posts: 2543
23 Nov 2013 01:50 PM
(Funny, but the question asker did say "Once again, no output.")...
Report Abuse
GiganticGulian is not online. GiganticGulian
Joined: 18 Feb 2011
Total Posts: 2233
23 Nov 2013 01:51 PM
Oh, then you shouldn't put these long stories about the script...
Report Abuse
GiganticGulian is not online. GiganticGulian
Joined: 18 Feb 2011
Total Posts: 2233
23 Nov 2013 01:53 PM
The problem is that there is no bug. The coroutines just never gets activated.

Try to replace all the "wrap"s with "resume"s.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
23 Nov 2013 01:56 PM
or add this at the end()
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