|
| 18 Sep 2012 11:35 AM |
I'm starting to get more advanced in my beginner level coding. I don't see the error(s) in this: function OnTouched(hit) game.Workspace.EnergyBridge.EnergyPlatform.CanColide = true game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.8 wait() game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.6 wait(6) game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.8 wait() game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 1 game.Workspace.EnergyBridge.EnergyPlatform.CanColide = false
Any help?
--Apparantly the forum dosent display my tabbing.-- |
|
|
| Report Abuse |
|
|
ckfeister
|
  |
| Joined: 27 Feb 2010 |
| Total Posts: 1506 |
|
|
| 18 Sep 2012 11:57 AM |
function OnTouched(hit) game.Workspace.EnergyBridge.EnergyPlatform.CanColide = true game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.8 wait() game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.6 wait(6) game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.8 wait() game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 1 game.Workspace.EnergyBridge.EnergyPlatform.CanColide = false end
script.Parent.Touched:connect(OnTouched)
[Wanna join a 70+ member group? Join my primaly!] |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2012 12:01 PM |
| Oh. Yeah. I forgot about that connection again. -_- |
|
|
| Report Abuse |
|
|
itunes89
|
  |
| Joined: 19 Jan 2011 |
| Total Posts: 1957 |
|
|
| 18 Sep 2012 12:01 PM |
And your end.
--Itunes89 Expert Scripter, Wiki Writer and Friend |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2012 12:08 PM |
| Still dosent activate the script. |
|
|
| Report Abuse |
|
|
itunes89
|
  |
| Joined: 19 Jan 2011 |
| Total Posts: 1957 |
|
|
| 18 Sep 2012 12:44 PM |
function OnTouched(hit) game.Workspace.EnergyBridge.EnergyPlatform.CanColide = true game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.8 wait() game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.6 wait(6) game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.8 wait() game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 1 game.Workspace.EnergyBridge.EnergyPlatform.CanColide = false end script.Parent.Touched:connect(OnTouched) |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Sep 2012 01:24 PM |
| When run correctly, this is supposed to make the brick change transparency and CanColide, then Transparency and CanColide again. It dosent work. Anyone see the error? |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2012 01:26 PM |
game.Workspace.EnergyBridge.EnergyPlatform.CanColide = true game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.8 wait(1) game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.6 wait(6) game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.8 wait(1) game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 1 game.Workspace.EnergyBridge.EnergyPlatform.CanColide = false end
script.Parent.Touched:connect(OnTouched)
|
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Sep 2012 01:52 PM |
function OnTouched(hit) game.Workspace.EnergyBridge.EnergyPlatform.CanCollide = true game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.8 wait() game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.6 wait(6) game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.8 wait() game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 1 game.Workspace.EnergyBridge.EnergyPlatform.CanCollide = false end
script.Parent.Touched:connect(OnTouched)
Next time, an output would be helpful.
¤ ¤ † K M X D † ¤ ¤ |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2012 02:01 PM |
| First of all, I use output. Second, that dosent work. |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2012 02:04 PM |
Then why didn't you post it? There had to be one because CanCollide was spelled incorrectly. Is your hierarchy right?
¤ ¤ † K M X D † ¤ ¤ |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2012 02:23 PM |
15:17:55 - CWorkspace::DoExecScript 15:17:55 - DataModel Loading http://www.roblox.com/asset/?id=27000387 15:19:33 - CApp::RobloxAuthenticate
Thats my output. |
|
|
| Report Abuse |
|
|
corto713
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 962 |
|
|
| 18 Sep 2012 02:34 PM |
Maybe try this?
function OnTouched() game.Workspace.EnergyBridge.EnergyPlatform.CanColide = true game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.8 wait(1) game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.6 wait(6) game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.8 wait(1) game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 1 game.Workspace.EnergyBridge.EnergyPlatform.CanColide = false end
script.Parent.Touched:connect(OnTouched)
|
|
|
| Report Abuse |
|
|
corto713
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 962 |
|
|
| 18 Sep 2012 02:36 PM |
Just re-read the script and they are right this would work...
function OnTouched() game.Workspace.EnergyBridge.EnergyPlatform.CanCollide = true game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.8 wait(1) game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.6 wait(6) game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.8 wait(1) game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 1 game.Workspace.EnergyBridge.EnergyPlatform.CanCollide = false end
script.Parent.Touched:connect(OnTouched)
|
|
|
| Report Abuse |
|
|
|
| 18 Sep 2012 02:39 PM |
| wait() makes it wait for .0030 of a second. No need for the 1. |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 18 Sep 2012 02:42 PM |
| @spicy. Well wait() is about near 0.003, but it's frame. It really matters, because wait() is relative, as it's longer when your frame rate drops. |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2012 02:44 PM |
| Also, someone else game me a (1) time script and it didn't work. |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2012 03:03 PM |
| You obviously messed up something in the script, or else it would work. |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2012 03:17 PM |
| Yeah, clearly. Why else would I put it up here? I have checked through the syntax and there are no mistakes there. |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Sep 2012 05:09 PM |
Maybe the mistake isn't your script... Maybe some other script is interfering with it, or you didn't name something properly. (Maybe you deactivated the script, too - That happens to me ;))
try this: In your Workspace, place a brick named "ThePart". Insert the following script inside a script loceted in Workspace.
function OnTouched(hit) game.Workspace.ThePart.CanCollide = true game.Workspace.ThePart.Transparency = 0.8 wait() game.Workspace.ThePart.Transparency = 0.6 wait(6) game.Workspace.ThePart.Transparency = 0.8 wait() game.Workspace.ThePart.Transparency = 1 game.Workspace.ThePart.CanCollide = false end
game.Workspace.ThePart.Touched:connect(OnTouched)
If it works, then the script is correct. Copy it, replace the "game.Workspace.ThePart" with the appropriate path for your original brick, and try it! |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 18 Sep 2012 05:11 PM |
function onhit(hit)
game.Workspace.EnergyBridge.EnergyPlatform.CanColide = true game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.8 wait(2) game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.6 wait(6) game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 0.8 wait(2) game.Workspace.EnergyBridge.EnergyPlatform.Transparency = 1 game.Workspace.EnergyBridge.EnergyPlatform.CanColide = false
script.Parent.Touched:connect(hit) |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2012 05:12 PM |
| Nota Praeter: If you re-read the scripts others wrote to try and help you, you will notice that most of them use "script.Parent.Touched". If your script isn't a direct child of the part you want to be affected by the script, they won't work. I fixed it in the script I just submitted. |
|
|
| Report Abuse |
|
|