|
| 18 Jul 2011 12:54 PM |
No error message, but it doesn't seem to do anything.
d = true Pads = {"Pad1", "Pad2", "Pad3", "Pad4"}
script.Parent.Touched:connect(function(hit) if not d then return end d = false if hit.Name ~= "Food" or hit.Name ~= "Can" then d = true return end hit:MoveTo(script.Parent[math.random(1,#Pads)].Position) hit.Anchored = true end) |
|
|
| Report Abuse |
|
|
|
| 18 Jul 2011 01:04 PM |
The simple "Help" title doesn't seem to get clicks anymore.
Anyway, this just moves a brick to a certain position an anchors it |
|
|
| Report Abuse |
|
|
|
| 18 Jul 2011 01:13 PM |
| I think most of the views are from me. |
|
|
| Report Abuse |
|
|
comiconor
|
  |
| Joined: 26 May 2009 |
| Total Posts: 16893 |
|
| |
|
|
| 18 Jul 2011 01:34 PM |
if hit.Name ~= "Food" or hit.Name ~= "Can" then d = true return end
Common sense (which some people surprisingly lack, no offense)
if hit.Name ~= "Food" and hit.Name ~= "Can" then d = true return end
|
|
|
| Report Abuse |
|
|
|
| 18 Jul 2011 01:36 PM |
@Citymaster, you must be talking about yourself because that means I need both food and can to hit it to work.
T_T |
|
|
| Report Abuse |
|
|
comiconor
|
  |
| Joined: 26 May 2009 |
| Total Posts: 16893 |
|
| |
|
comiconor
|
  |
| Joined: 26 May 2009 |
| Total Posts: 16893 |
|
| |
|
|
| 18 Jul 2011 01:38 PM |
"or" cannot be used there. if name ~= "Food" or name ~= "Can" If the name is not equal to food or the name is not equal to can. |
|
|
| Report Abuse |
|
|
comiconor
|
  |
| Joined: 26 May 2009 |
| Total Posts: 16893 |
|
| |
|
| |
|
comiconor
|
  |
| Joined: 26 May 2009 |
| Total Posts: 16893 |
|
| |
|
|
| 18 Jul 2011 01:41 PM |
| And saying that I make no sense. My turn to flame ;P |
|
|
| Report Abuse |
|
|
|
| 18 Jul 2011 01:43 PM |
| If hit.Name *IS NOT* "Food" or hit.Name *IS NOT* "Can" then RETURN END! |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 18 Jul 2011 01:43 PM |
Using "if" statement "or" doesn't work. Idk why, but thats reason why there is things like this:
somthing = "cat"
if somthing == "dog" then print("Its dog!") elseif somthing == "rat" then print("Its rat!") end
|
|
|
| Report Abuse |
|
|
|
| 18 Jul 2011 01:44 PM |
| You can't do that. Just say it outloud and you will get it. You want it so if the name is not food or can then it retunrs right? Use and. |
|
|
| Report Abuse |
|
|
|
| 18 Jul 2011 01:45 PM |
If the hit's name is not food or can then return end.
It seems okay to me. |
|
|
| Report Abuse |
|
|
comiconor
|
  |
| Joined: 26 May 2009 |
| Total Posts: 16893 |
|
| |
|
donut222
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 1837 |
|
| |
|
|
| 18 Jul 2011 01:47 PM |
| WHY THE HECK CAN'T YOU JUST ACCEPT THAT IT HAS TO BE "AND" NOT "OR". |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 18 Jul 2011 01:48 PM |
| @donut. Wtp? Thats nosence for this thread. |
|
|
| Report Abuse |
|
|
|
| 18 Jul 2011 01:48 PM |
| He's totally on the wrong part. |
|
|
| Report Abuse |
|
|
|
| 18 Jul 2011 01:49 PM |
citymaster22, you should know that the script still doesn't work, even with and.
:) |
|
|
| Report Abuse |
|
|
|
| 18 Jul 2011 01:51 PM |
| That's a different issue. Is tehre any output now? |
|
|
| Report Abuse |
|
|
Fl0x
|
  |
| Joined: 06 Aug 2010 |
| Total Posts: 5169 |
|
|
| 18 Jul 2011 01:53 PM |
All I can say is... MoveTo is not a valid member of BasePart. |
|
|
| Report Abuse |
|
|