isc88
|
  |
| Joined: 30 May 2013 |
| Total Posts: 27545 |
|
|
| 23 Sep 2015 05:16 PM |
The goal is to have a tool that creates a part where the mouse is pointed, welds it to where the mouse was pointed, and unanchorses it
It works like a charm the first time you use it, everything works perfectly
But the second time you use it the part doesn't unanchor
waito = false function onButton1Down(mouse) if mouse.Target == nil then return end if mouse.Target.className == "Part" or mouse.Target.className == "UnionOperation" or mouse.Target.className == "WedgePart" then if mouse.Target.Locked == true then return end if waito == true then return end tar = mouse.Target thrust = Instance.new("Part", game.Workspace) thrust.Size = Vector3.new(1,1,1) thrust.Position = Vector3.new(mouse.Hit.p) thrust.CFrame = CFrame.new(mouse.Hit.p) thrust.Locked = true thrust.Anchored = true thrust.Name = "Thruster" mouse.Target.Anchored = true for n,o in pairs(mouse.Target.Parent:GetChildren()) do if mouse.Target.Parent:IsA("Model")then if o:IsA("Part")or o:IsA("WedgePart") or o:IsA("UnionOperation") then o.Anchored = true end end end waito = true wait(.3) local W = Instance.new("Weld") W.Part0 = tar W.Part1 = thrust local CJ = CFrame.new(tar.Position) local C0 =tar.CFrame:inverse()*CJ local C1 = thrust.CFrame:inverse()*CJ W.C0 = C0 W.C1 = C1 W.Parent = tar W.Name = "thrustWeld" for n,o in pairs(tar.Parent:GetChildren()) do if tar.Parent:IsA("Model")then if o:IsA("Part")or o:IsA("WedgePart") or o:IsA("UnionOperation") then o.Anchored = false end end end thrust.Anchored = false wait(.2) waito = false end end
function onSelected(mouse) mouse.Button1Down:connect(function() onButton1Down(mouse) end) end
script.Parent.Equipped:connect(onSelected)
what siggy |
|
|
| Report Abuse |
|
|
isc88
|
  |
| Joined: 30 May 2013 |
| Total Posts: 27545 |
|
| |
|
isc88
|
  |
| Joined: 30 May 2013 |
| Total Posts: 27545 |
|
| |
|
lsp425
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 603 |
|
|
| 23 Sep 2015 05:33 PM |
waito = false function onButton1Down(mouse) local tar = mouse.Target if tar == nil then return end if tar.className == "Part" or tar.className == "UnionOperation" or tar.className == "WedgePart" then if tar.Locked == true then return end if waito == true then return end local thrust = Instance.new("Part", game.Workspace) thrust.Size = Vector3.new(1,1,1) thrust.Position = Vector3.new(mouse.Hit.p) thrust.CFrame = CFrame.new(mouse.Hit.p) thrust.Locked = true thrust.Anchored = true thrust.Name = "Thruster" mouse.Target.Anchored = true for n,o in pairs(mouse.Target.Parent:GetChildren()) do if mouse.Target.Parent:IsA("Model")then if o:IsA("Part")or o:IsA("WedgePart") or o:IsA("UnionOperation") then o.Anchored = true end end end waito = true wait(.3) local W = Instance.new("Weld") W.Part0 = tar W.Part1 = thrust local CJ = CFrame.new(tar.Position) local C0 =tar.CFrame:inverse()*CJ local C1 = thrust.CFrame:inverse()*CJ W.C0 = C0 W.C1 = C1 W.Parent = tar W.Name = "thrustWeld" for n,o in pairs(tar.Parent:GetChildren()) do if tar.Parent:IsA("Model")then if o:IsA("Part")or o:IsA("WedgePart") or o:IsA("UnionOperation") then o.Anchored = false end end end thrust.Anchored = false wait(.2) waito = false end end
function onSelected(mouse) mouse.Button1Down:connect(function() onButton1Down(mouse) end) end
script.Parent.Equipped:connect(onSelected)
This worked perfectly for me. |
|
|
| Report Abuse |
|
|
isc88
|
  |
| Joined: 30 May 2013 |
| Total Posts: 27545 |
|
|
| 23 Sep 2015 05:34 PM |
@LSP
didn't work for me
What i'm doing is i'm using unanchored props (benches, beds etc)
what siggy |
|
|
| Report Abuse |
|
|
lsp425
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 603 |
|
|
| 23 Sep 2015 05:36 PM |
| Is it a tool or a hopperbin, if it's a tool is there a "Handle" < Stupid question. |
|
|
| Report Abuse |
|
|
isc88
|
  |
| Joined: 30 May 2013 |
| Total Posts: 27545 |
|
|
| 23 Sep 2015 05:36 PM |
it is a tool with a handle.
what siggy |
|
|
| Report Abuse |
|
|
Codys4x4
|
  |
| Joined: 14 Oct 2006 |
| Total Posts: 2312 |
|
|
| 23 Sep 2015 05:37 PM |
I'm doing something like this, but why use a tool?
Check these games out http://www.roblox.com/games/297687077/Profit-Finder?autoplay=true and http://www.roblox.com/games/299358247/Snipe-Finder?autoplay=true -Codys4x4 |
|
|
| Report Abuse |
|
|
lsp425
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 603 |
|
|
| 23 Sep 2015 05:38 PM |
| Tools are easier for some, idk. |
|
|
| Report Abuse |
|
|
isc88
|
  |
| Joined: 30 May 2013 |
| Total Posts: 27545 |
|
|
| 23 Sep 2015 05:38 PM |
It's for a garry's mod replica.
what siggy |
|
|
| Report Abuse |
|
|
isc88
|
  |
| Joined: 30 May 2013 |
| Total Posts: 27545 |
|
| |
|
isc88
|
  |
| Joined: 30 May 2013 |
| Total Posts: 27545 |
|
| |
|
isc88
|
  |
| Joined: 30 May 2013 |
| Total Posts: 27545 |
|
| |
|
isc88
|
  |
| Joined: 30 May 2013 |
| Total Posts: 27545 |
|
| |
|
isc88
|
  |
| Joined: 30 May 2013 |
| Total Posts: 27545 |
|
| |
|
isc88
|
  |
| Joined: 30 May 2013 |
| Total Posts: 27545 |
|
| |
|