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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Whats the Error? (10 lines)

Previous Thread :: Next Thread 
Wolfhead666 is not online. Wolfhead666
Joined: 13 Jan 2010
Total Posts: 881
30 Nov 2014 09:37 PM
This is a model named doors. There are 2 parts inside it named door1 and door2. When you touch door1 it is supposed to go transparent and become unable to collide and vice versa for door2. It is supposed ot look like the door opens when you touch it. What'd i do wrong?

doors=script.Parent
function onTouched(hit)
doors['door1'].Transparency=1
doors['door1'].CanCollide=false
doors['door2'].Transparency=0
doors['door2'].CanCollide=true
wait(5)
doors['door1'].Transparency=0
doors['door1'].CanCollide=true
doors['door2'].Transparency=1
doors['door2'].CanCollide=false
end

Thanks
Report Abuse
CoolioTree is not online. CoolioTree
Joined: 26 Dec 2012
Total Posts: 2509
30 Nov 2014 09:38 PM
why
Report Abuse
tentastic2 is not online. tentastic2
Joined: 03 May 2009
Total Posts: 241
30 Nov 2014 09:40 PM
the function isn't called
Report Abuse
Wolfhead666 is not online. Wolfhead666
Joined: 13 Jan 2010
Total Posts: 881
30 Nov 2014 09:41 PM
???
Report Abuse
CoolioTree is not online. CoolioTree
Joined: 26 Dec 2012
Total Posts: 2509
30 Nov 2014 09:42 PM
doors.Touched:connect(onTouched)

add that to the end.
Report Abuse
tentastic2 is not online. tentastic2
Joined: 03 May 2009
Total Posts: 241
30 Nov 2014 09:43 PM
At the bottom of the script you need to have:


doors['door1'].Touched:connect(onTouched)
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
30 Nov 2014 09:43 PM
um thats a wierd way to do that,

door1 = script.Parent.door1
door2 = script.Parent.door2

function open(hit)
door1.CanCollide = false
door1.Transparency = 1
door2.CanCollide = true
door2.Transparency = 0
wait(5)
door1.CanCollide = true
door1.Transparency = 0
door2.CanCollide = false
door2.Transparency = 1
end
--but you would need to know what is getting hit, door one or door two so..
script.Parent.door1.Touched:connect(open)
Report Abuse
tentastic2 is not online. tentastic2
Joined: 03 May 2009
Total Posts: 241
30 Nov 2014 09:44 PM
@Coolio a model can't be touched.
Report Abuse
tentastic2 is not online. tentastic2
Joined: 03 May 2009
Total Posts: 241
30 Nov 2014 09:45 PM
@chimm the great thing about scripting is that there are multiple ways to accomplish the same task. The only question is which way is more efficient
Report Abuse
Wolfhead666 is not online. Wolfhead666
Joined: 13 Jan 2010
Total Posts: 881
30 Nov 2014 09:45 PM
oh yea right XD but it still doesn't work so there is something else i messed up

doors=script.Parent
function onTouched(hit)
doors['door1'].Transparency=1
doors['door1'].CanCollide=false
doors['door2'].Transparency=0
doors['door2'].CanCollide=true
wait(5)
doors['door1'].Transparency=0
doors['door1'].CanCollide=true
doors['door2'].Transparency=1
doors['door2'].CanCollide=false

end
script.Parent.Touched:connect(onTouched)
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
30 Nov 2014 09:46 PM
"doors['door1']" is longer to write than "door1"
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
30 Nov 2014 09:47 PM
a model can not be touched
Report Abuse
Wolfhead666 is not online. Wolfhead666
Joined: 13 Jan 2010
Total Posts: 881
30 Nov 2014 09:47 PM
ah chim your way worked, thanks!
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
30 Nov 2014 09:48 PM
you must have a part that will be touched
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
30 Nov 2014 09:48 PM
np
Report Abuse
Wolfhead666 is not online. Wolfhead666
Joined: 13 Jan 2010
Total Posts: 881
30 Nov 2014 09:58 PM
Oh i get it thanks man it helps!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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