opplo
|
  |
| Joined: 09 Dec 2008 |
| Total Posts: 5320 |
|
|
| 23 Feb 2011 08:48 AM |
How would you make a brick stick to another on touch. It cant anchor ontouched.
Help would be greatly appretiated i,ve been trying to do this for months and i just cant figure it out. |
|
|
| Report Abuse |
|
|
ellosss
|
  |
| Joined: 15 Mar 2009 |
| Total Posts: 7030 |
|
|
| 23 Feb 2011 08:58 AM |
local brck=script.Parent
brck.Touched:connect( function(hit) if hit.Parent then local w=Instance.new("Weld",hit) w.Part0=hit w.Part1=brck w.C0=hit.CFrame w.C1=brck.CFrame end end) |
|
|
| Report Abuse |
|
|
ellosss
|
  |
| Joined: 15 Mar 2009 |
| Total Posts: 7030 |
|
| |
|
opplo
|
  |
| Joined: 09 Dec 2008 |
| Total Posts: 5320 |
|
| |
|
opplo
|
  |
| Joined: 09 Dec 2008 |
| Total Posts: 5320 |
|
| |
|
razourik
|
  |
| Joined: 21 Jan 2009 |
| Total Posts: 1155 |
|
|
| 23 Feb 2011 10:09 AM |
| I think that code will work :D But the sticky brick needs to be named "brck" because he wasn't quite smart enough to spell "brick" XD |
|
|
| Report Abuse |
|
|
opplo
|
  |
| Joined: 09 Dec 2008 |
| Total Posts: 5320 |
|
|
| 23 Feb 2011 10:16 AM |
| it doesnt matter what he spells that as. |
|
|
| Report Abuse |
|
|
opplo
|
  |
| Joined: 09 Dec 2008 |
| Total Posts: 5320 |
|
|
| 23 Feb 2011 10:45 AM |
| bump anyone think it doesnt work? |
|
|
| Report Abuse |
|
|
|
| 23 Feb 2011 10:53 AM |
function onTouched(hit) local h = hit.Parent:FindFirstChild("Humanoid") if h then h.Parent.Anchored = true end end |
|
|
| Report Abuse |
|
|
opplo
|
  |
| Joined: 09 Dec 2008 |
| Total Posts: 5320 |
|
| |
|
|
| 23 Feb 2011 10:55 AM |
| No offence oppolo but why dont you try it out by yourself ? Also Just read what he wanted to know at the top, the script you posted wouldnt work aswell. |
|
|
| Report Abuse |
|
|
opplo
|
  |
| Joined: 09 Dec 2008 |
| Total Posts: 5320 |
|
|
| 23 Feb 2011 10:59 AM |
| Beacause im busy in a game with someone so i cant go test it also whos wouldnt work? |
|
|
| Report Abuse |
|
|
|
| 23 Feb 2011 11:01 AM |
| Justa's ... It has no connection line, and it isnt following what you was asking ... |
|
|
| Report Abuse |
|
|
AK7B2A
|
  |
| Joined: 09 Jan 2009 |
| Total Posts: 395 |
|
|
| 23 Feb 2011 11:04 AM |
| tell the guy you don't know if you don't |
|
|
| Report Abuse |
|
|
opplo
|
  |
| Joined: 09 Dec 2008 |
| Total Posts: 5320 |
|
|
| 23 Feb 2011 11:09 AM |
| I know but would the other guys work? |
|
|
| Report Abuse |
|
|
|
| 23 Feb 2011 11:20 AM |
Put this in the part: function stick(x,y) weld = Instance.new("Weld") weld.Part0 = x weld.Part1 = y local HitPos = x.Position local CJ = CFrame.new(HitPos) local C0 = x.CFrame:inverse() *CJ local C1 = y.CFrame:inverse() * CJ weld.C0 = C0 weld.C1 = C1 weld.Parent = x end
function onTouched(hit) stick(hit,script.Parent) end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
WK100
|
  |
| Joined: 13 Oct 2008 |
| Total Posts: 2835 |
|
|
| 23 Feb 2011 11:27 AM |
| Why don't you learn to script, read the script and find out? |
|
|
| Report Abuse |
|
|
| |
|
opplo
|
  |
| Joined: 09 Dec 2008 |
| Total Posts: 5320 |
|
| |
|
ellosss
|
  |
| Joined: 15 Mar 2009 |
| Total Posts: 7030 |
|
|
| 23 Feb 2011 11:41 AM |
| My script works fine. Just put the script in the part you want to be sticky. ^^ |
|
|
| Report Abuse |
|
|
|
| 23 Feb 2011 01:18 PM |
Yeah forgot connection line!
|
|
|
| Report Abuse |
|
|