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: Script works but doesnt work?

Previous Thread :: Next Thread 
zach0arythesniper79 is online. zach0arythesniper79
Joined: 18 Aug 2011
Total Posts: 211
31 Dec 2013 08:38 PM
So on my obby i've been making there is dissapearing bricks so you have to jump quick but there's a problem.. I don't now why the script is not working.. I'm a little bit of a noob at coding by the way so don't judge

a = game.Workspace.Base
function onTouch(part)
a.CanCollide = false
then
a.transparency = 1
wait(2)
a.CanCollide = true
then
a.transparency = 0
Wait (2)
end
a.Touched : connect(onTouch)


Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
31 Dec 2013 08:41 PM
a = game.Workspace.Base
function onTouch(part)
if a.CanCollide == false then
a.transparency = 1
a.CanCollide = true
else
a.transparency = 0
a.CanCollide = false
end
a.Touched:connect(onTouch)

that should work:P
Report Abuse
DrRandomous is not online. DrRandomous
Joined: 25 Mar 2011
Total Posts: 1702
31 Dec 2013 08:41 PM
a = game.Workspace.Base
function onTouch(part)
a.CanCollide = false
a.transparency = 1
wait(2)
a.CanCollide = true
a.transparency = 0
wait(2)
end
a.Touched:connect(onTouch)
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
31 Dec 2013 08:42 PM
Remove the 'then's and your script'll be perfect
Report Abuse
Articulating is not online. Articulating
Joined: 12 Nov 2011
Total Posts: 708
31 Dec 2013 08:44 PM
transparency is not a valid member of BasePart.
However, Transparency is.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
31 Dec 2013 08:47 PM
Darn..I shouldve spotted that..
Report Abuse
zach0arythesniper79 is online. zach0arythesniper79
Joined: 18 Aug 2011
Total Posts: 211
31 Dec 2013 08:51 PM
and who says everyone on the forums are jerks :). Thanks guys
Report Abuse
zach0arythesniper79 is online. zach0arythesniper79
Joined: 18 Aug 2011
Total Posts: 211
31 Dec 2013 09:03 PM
but wait ... some of teh paltforms dont work and the ones that do dont turn invisble? this is the place if you wanna take a look http://www.roblox.com/The-Epic-Obby-Free-admin-at-the-end-place?id=129111569
Report Abuse
zach0arythesniper79 is online. zach0arythesniper79
Joined: 18 Aug 2011
Total Posts: 211
31 Dec 2013 09:04 PM
wait am i not supposed to copy scripts maybe thats why?
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
31 Dec 2013 09:11 PM
a = script.Parent
function onTouch(part)
if a.CanCollide == false then
a.transparency = 1
a.CanCollide = true
else
a.transparency = 0
a.CanCollide = false
end
a.Touched:connect(onTouch)
Put rhe script INTO the part..instead of the workspace..soo
Insert the script Into the part..and paste what I have above
Like..
Insert
Basic objects
Script
Edit it..paste the script in..
Drag the script to the part in the explorer
Copy the script and put it in any other bricks u want to do the same thing with
Report Abuse
TheEliteDonphan is not online. TheEliteDonphan
Joined: 16 Jun 2013
Total Posts: 2647
31 Dec 2013 09:15 PM
ew so inefficient

a = game.Workspace.Base
script.Parent.Touched:connect(function()
if a.CanCollide and a.Transparency=0 then a.CanCollide=not a.CanCollide and a.Transparency=1
end)
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
31 Dec 2013 09:17 PM
Really?? Inefficient?? R u joking?
What if there's more than one part?
a = script.Parent
Should be used...
Report Abuse
TheEliteDonphan is not online. TheEliteDonphan
Joined: 16 Jun 2013
Total Posts: 2647
31 Dec 2013 09:19 PM
sorry i wrote that in like 4 seconds

a = game.Workspace.Base
a.Touched:connect(function()
if a.CanCollide and a.Transparency=0 then a.CanCollide=not a.CanCollide and a.Transparency=1
end)
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
31 Dec 2013 09:19 PM
Having to define the name of every part?
So inefficient
Report Abuse
TheEliteDonphan is not online. TheEliteDonphan
Joined: 16 Jun 2013
Total Posts: 2647
31 Dec 2013 09:20 PM
island
you dont know how to script
get out plz kbai
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
31 Dec 2013 09:23 PM
Lol what? The way u did it..he'd need sevral scripts defining each part..when he could use mind, paste it in a part, and copy the part..and every parr he copys would work..instead of using
a= Workspace.partname
Dostuff
another script. .
a = Workapace.anotherpart...
That is really ineffecient..
Report Abuse
TheEliteDonphan is not online. TheEliteDonphan
Joined: 16 Jun 2013
Total Posts: 2647
31 Dec 2013 09:25 PM
island i found a thing that could help you

3rd grade+ a dictionary

also

a = game.Workspace.MODELHERE:GetChildren()
for i=1, #a do
a[i].Touched:connect(function()
if a[i].CanCollide and a[i].Transparency=0 then a[i].CanCollide=not a[i].CanCollide and a[i].Transparency=1
end)
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
31 Dec 2013 09:25 PM
Dang. .I just got ninjaed. .
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
31 Dec 2013 09:27 PM
And I can do grade 12 algerbra (not my h obby or anything tho..)
Bt I don't need a dictionary. .
P.s I'm using a phone (very small screen, very fast typer..)
Report Abuse
TheEliteDonphan is not online. TheEliteDonphan
Joined: 16 Jun 2013
Total Posts: 2647
31 Dec 2013 09:28 PM
a = game.Workspace.MODELHERE:GetChildren()
for i=1, #a do
a[i].Touched:connect(function()
if a[i].CanCollide and a[i].Transparency=0 then a[i].CanCollide=not a[i].CanCollide and a[i].Transparency=1
wait(1)
a[i].CanCollide=not a[i].CanCollide
a[i].Transparency=0
end)
Report Abuse
zach0arythesniper79 is online. zach0arythesniper79
Joined: 18 Aug 2011
Total Posts: 211
31 Dec 2013 09:51 PM
idk why neither of the scripts work
Report Abuse
zach0arythesniper79 is online. zach0arythesniper79
Joined: 18 Aug 2011
Total Posts: 211
31 Dec 2013 09:56 PM
it wont let em add a touchintrest thing
Report Abuse
zach0arythesniper79 is online. zach0arythesniper79
Joined: 18 Aug 2011
Total Posts: 211
31 Dec 2013 10:01 PM
Btw all teh parts are called Basse so...
Report Abuse
zach0arythesniper79 is online. zach0arythesniper79
Joined: 18 Aug 2011
Total Posts: 211
31 Dec 2013 10:22 PM
bump
Report Abuse
zach0arythesniper79 is online. zach0arythesniper79
Joined: 18 Aug 2011
Total Posts: 211
31 Dec 2013 10:47 PM
This is getting really annoying why wont it work
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