icanxlr8
|
  |
| Joined: 25 Feb 2009 |
| Total Posts: 3686 |
|
|
| 02 Jun 2012 05:41 PM |
I'm making a path that only I can walk on, but my script isn't working.
print 'ican's got swag' function y(hit) if hit.Parent.Name = "icanxlr8" then script.Parent.CanCollide = true script.Parent.Trasparency = 0 wait(20) script.Parent.CanCollide = false script.Parent.Transparency = 1 else script.Parent.CanCollide = false end
script.Parent.Touched:connect(y)
Are there supposed to be tabs, or is there a mistake? I sorta think there is a problem with line 3. |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2012 05:44 PM |
I don't think tabs matter. They make it look easier to read I think. Also, for like 3 I think it should be.... if hit.Name == "icanxlr8" then
2iC of RoNation |
|
|
| Report Abuse |
|
|
icanxlr8
|
  |
| Joined: 25 Feb 2009 |
| Total Posts: 3686 |
|
| |
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 03 Jun 2012 05:51 AM |
When using a comparative statement, you always need to use the '==' operator, as oppose to the regular '='.
Easy mistake to make. |
|
|
| Report Abuse |
|
|
|
| 03 Jun 2012 06:02 AM |
print 'ican's got swag'
May error because of the third ' |
|
|
| Report Abuse |
|
|
icanxlr8
|
  |
| Joined: 25 Feb 2009 |
| Total Posts: 3686 |
|
| |
|
|
| 03 Jun 2012 10:51 AM |
There is 3...
print('ican's got swag')) > Workspace.Script:1: ')' expected near 's'
print('icans got swag')) > icans got swag |
|
|
| Report Abuse |
|
|
|
| 03 Jun 2012 10:55 AM |
There are three. The apostrophe in the text counts. The computer can't tell the difference.
Use double quotes instead there. |
|
|
| Report Abuse |
|
|
icanxlr8
|
  |
| Joined: 25 Feb 2009 |
| Total Posts: 3686 |
|
| |
|
icanxlr8
|
  |
| Joined: 25 Feb 2009 |
| Total Posts: 3686 |
|
| |
|
icanxlr8
|
  |
| Joined: 25 Feb 2009 |
| Total Posts: 3686 |
|
| |
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 04 Jun 2012 10:31 AM |
print "ican's got swag" deb = true function y(hit) if hit.Parent.Name == "icanxlr8" and deb then deb = false script.Parent.CanCollide = true script.Parent.Trasparency = 0 wait(20) script.Parent.CanCollide = false script.Parent.Transparency = 1 deb = true else script.Parent.CanCollide = false end end
script.Parent.Touched:connect(y) |
|
|
| Report Abuse |
|
|
icanxlr8
|
  |
| Joined: 25 Feb 2009 |
| Total Posts: 3686 |
|
| |
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
| |
|
icanxlr8
|
  |
| Joined: 25 Feb 2009 |
| Total Posts: 3686 |
|
|
| 04 Jun 2012 10:38 AM |
| Great. Now it works, but it isn't letting icanxlr8 in. Just staying CannotCollide and transparent. |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 04 Jun 2012 10:39 AM |
You do know the meaning of CanCollide? If it's true you can't walk trough it, otherwise you can. |
|
|
| Report Abuse |
|
|
icanxlr8
|
  |
| Joined: 25 Feb 2009 |
| Total Posts: 3686 |
|
|
| 04 Jun 2012 10:42 AM |
| Yeah, but I can't walk on it, which I am supposed to be able to do. |
|
|
| Report Abuse |
|
|
icanxlr8
|
  |
| Joined: 25 Feb 2009 |
| Total Posts: 3686 |
|
| |
|