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: On touch help

Previous Thread :: Next Thread 
DaDesign is not online. DaDesign
Joined: 27 Apr 2014
Total Posts: 53
06 Jun 2014 02:58 PM
I'm just getting started in scripting and I am trying to figure out how to change a decals transparency when you touch a certain block, I tried this but it didn't work..

function OnTouched()
if game.Workspace.Test.Decal1.Transparency = 0
wait 2
game.Worspace.Test.Decal1.Transparency = 1
end
end
Report Abuse
USAGroupHolder is not online. USAGroupHolder
Joined: 26 Jul 2013
Total Posts: 513
06 Jun 2014 03:01 PM
1. I don't think you can change transperancy of a decal. 2. wait 2 needs to be wait(2)

function OnTouched()
if game.Workspace.Test.Decal1.Transparency = 0
wait(2) -- changed
game.Worspace.Test.Decal1.Transparency = 1
end
end
Report Abuse
DaDesign is not online. DaDesign
Joined: 27 Apr 2014
Total Posts: 53
06 Jun 2014 03:02 PM
Hmm is there a way to change like a blocks trancparency?
Report Abuse
Kilometerz is not online. Kilometerz
Joined: 20 Sep 2012
Total Posts: 2666
06 Jun 2014 03:04 PM
Decals transparency cannot be changed.
You has no output either

function OnTouched()
if game.Workspace.Test.Decal1.Transparency = 0
wait ( 2)
game.Worspace.Test.Decal1.Transparency = 1
end
end

script.Parent.Touched:connect(onTouched)

Also its wait(2)
Report Abuse
Kilometerz is not online. Kilometerz
Joined: 20 Sep 2012
Total Posts: 2666
06 Jun 2014 03:05 PM
Yeah

function onTouched(hit)

wait(2)

game.Workspace.Block1.Transparency = 1

end
script.Parent.Touched:connect(onTouched)
Report Abuse
DaDesign is not online. DaDesign
Joined: 27 Apr 2014
Total Posts: 53
06 Jun 2014 03:12 PM
thanks, Ill have some more scripts later that need revising too im sure.
Report Abuse
DaDesign is not online. DaDesign
Joined: 27 Apr 2014
Total Posts: 53
06 Jun 2014 03:36 PM
Ok soooo I ran into another problem..
I want to check to see if one blocks transparency is 0 and a block was touched then make another blocks transparency set to 0 and this won't work

function onTouched(hit)

wait(0.1)

if game.Workspace.b1.Transparency = 0

wait(1)

game.Workspace.b2.Transparency = 1

end
script.Parent.Touched:connect(onTouched)
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
06 Jun 2014 03:43 PM
you need two ==s to compare values, not one, and you forgot the 'then'

so
if game.Workspace.b1.Transparency == 1 then



Report Abuse
tanlolol12345 is not online. tanlolol12345
Joined: 20 Jan 2012
Total Posts: 20664
06 Jun 2014 03:47 PM
function OnTouched(hit)
if game.Workspace.Test.Decal1.Transparency = 0
wait 2
game.Worspace.Test.Decal1.Transparency = 1
end
end

Script.Parent.hit:connect(OnToutched)

I believe its latin for "Skip the boring parts". | FRAPPE ATTACK!
Report Abuse
DaDesign is not online. DaDesign
Joined: 27 Apr 2014
Total Posts: 53
06 Jun 2014 03:51 PM
Ok so I tried that and moved stuff around so it would function the proper way and it still didn't work :/ (I'm really sorry I'm really new to scripting)

if game.Workspace.b1.Transparency == 0 then

function onTouched(hit)

wait(2)

game.Workspace.b2.Transparency = 0

end
script.Parent.Touched:connect(onTouched)
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