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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|