|
| 30 May 2013 05:41 PM |
function OnTouched(hit) local anchored = hit.Parent.Anchored == false if anchored == nil then return end if anchored ~= nil then wait(.3) hit.Anchored = true end end
why won't this work |
|
|
| Report Abuse |
|
|
|
| 30 May 2013 05:43 PM |
Run it with output open. output output! OUTPUT! OUTPUT!!! |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 30 May 2013 05:43 PM |
local anchored = hit.Parent.Anchored == false
ummmm, no. Just... no. |
|
|
| Report Abuse |
|
|
|
| 30 May 2013 05:45 PM |
@magna tell me how to fix it. if you're so smart then tell me how to fix it instead of criticizing me. |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 30 May 2013 05:45 PM |
| Well what are you even trying to do there? |
|
|
| Report Abuse |
|
|
NeonBlox
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 1462 |
|
|
| 30 May 2013 05:46 PM |
Think this is what you were looking for.
db = false
script.Parent.Touched:connect(function() if script.Parent.Anchored == true and db == false then script.Parent.Anchored, db = false, true else script.Parent.Anchored = true end wait(.3) db = false end) |
|
|
| Report Abuse |
|
|
|
| 30 May 2013 05:51 PM |
@neon/ @magma
What I am trying to do is make it so if anything touches my baseplate that isn't anchored it becomes anchored. |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 30 May 2013 05:52 PM |
function OnTouched(hit) if(hit) then hit.Parent.Anchored = true end end |
|
|
| Report Abuse |
|
|
NeonBlox
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 1462 |
|
|
| 30 May 2013 05:53 PM |
Put my script in the baseplate, and it will do that. But if something touches it again it will anchor. If you want it just to fall when it's touched, use this.
script.Parent.Touched:connect(function() script.Parent.Anchored = false end) |
|
|
| Report Abuse |
|
|
|
| 30 May 2013 05:54 PM |
@magna didn't work yo @neon thanks i'll try |
|
|
| Report Abuse |
|
|
| |
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 30 May 2013 05:55 PM |
| You do have a connection line right? |
|
|
| Report Abuse |
|
|
|
| 30 May 2013 05:56 PM |
what i meant was if anything touched the baseplate then the part that touched it was unanchored.
like this
[_____]
{ BASEPLATE } ^ when that part touches it the part is unanchored. |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 30 May 2013 05:59 PM |
put this in the baseplate
function OnTouched(hit) if(hit) then hit.Parent.Anchored = true end end
script.Parent.Touched:connect(OnTouched) |
|
|
| Report Abuse |
|
|
| |
|
NeonBlox
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 1462 |
|
| |
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 30 May 2013 06:03 PM |
ohh unanchored (i really don't understand why you would want that)
function OnTouched(hit) if(hit) then hit.Parent.Anchored = false end end
script.Parent.Touched:connect(OnTouched) |
|
|
| Report Abuse |
|
|
|
| 30 May 2013 06:12 PM |
no i want the brick ANCCHOORRED WHEN IT TOUCHES IT it wont work qqqqqqq
|
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 30 May 2013 06:15 PM |
function OnTouched(hit) if(hit) then hit.Anchored = true end end
script.Parent.Touched:connect(OnTouched)
thats tested and it works. |
|
|
| Report Abuse |
|
|
|
| 30 May 2013 06:19 PM |
| what if the baseplate can't collide? then what? |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
| |
|
|
| 30 May 2013 06:22 PM |
| .... there's a property called "CanCollide"... what if it's false? |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
| |
|
|
| 30 May 2013 06:24 PM |
| hmm... I'm not sure why this won't then. :/ |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 30 May 2013 06:25 PM |
| If it's not working for you, your putting the script in the wrong place. |
|
|
| Report Abuse |
|
|