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: Why Won't This Work?

Previous Thread :: Next Thread 
Abillityx is not online. Abillityx
Joined: 26 Feb 2011
Total Posts: 3938
07 Jan 2012 06:24 PM
Geo=game.Workspace.Brick
Geo.Touched:connect(OnTouch)
Geo.Transparency=0.5
wait(1)
Geo.Touched:connect(OnTouch)
Geo.Transparency=0
wait(1)
end
Report Abuse
jdm281 is not online. jdm281
Joined: 15 Jan 2010
Total Posts: 177
07 Jan 2012 06:30 PM
You dident make a function try:

Geo=game.Workspace.Brick
db = false

function OnTouch()
if Geo.Transparency == 0 and db == false then
db = true
Geo.Transparency=0.5
wait(1)
db = false
elseif db == false then
Geo.Transparency = 0
wait(1)
end

Geo.Touched:connect(OnTouch)
Report Abuse
jdm281 is not online. jdm281
Joined: 15 Jan 2010
Total Posts: 177
07 Jan 2012 06:31 PM
O wait you need another db = false after the last wait
Report Abuse
Chronok is not online. Chronok
Joined: 29 Dec 2011
Total Posts: 402
07 Jan 2012 06:31 PM
Put this script in the brick and it should work.

    local partObject = script.Parent
    partObject.Touched:connect(function(partItem)
        partObject.Transparency = .5
        wait(1)
        partObject.Transparency = 0
    end)

{ ["Chronok"] = "Intermediate scripter/programmer." }
Report Abuse
Chronok is not online. Chronok
Joined: 29 Dec 2011
Total Posts: 402
07 Jan 2012 06:33 PM
Ack, forgot debounce.

    local deBounce = false
    local partObject = script.Parent
    
    partObject.Touched:connect(function(partItem)
        if deBounce then return end
        deBounce = true
        partObject.Transparency = .5
        wait(1)
        partObject.Transparency = 0
        deBounce = false
    end)

{ ["Chronok"] = "Intermediate scripter/programmer." }
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