generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Just one tiny fix until this is done

Previous Thread :: Next Thread 
isc88 is not online. 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 is not online. isc88
Joined: 30 May 2013
Total Posts: 27545
23 Sep 2015 05:22 PM
qqqqq


what siggy
Report Abuse
isc88 is not online. isc88
Joined: 30 May 2013
Total Posts: 27545
23 Sep 2015 05:28 PM
anyone


what siggy
Report Abuse
lsp425 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. lsp425
Joined: 10 Dec 2011
Total Posts: 603
23 Sep 2015 05:38 PM
Tools are easier for some, idk.
Report Abuse
isc88 is not online. 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 is not online. isc88
Joined: 30 May 2013
Total Posts: 27545
23 Sep 2015 05:40 PM
:/


what siggy
Report Abuse
isc88 is not online. isc88
Joined: 30 May 2013
Total Posts: 27545
23 Sep 2015 05:44 PM
bump...


what siggy
Report Abuse
isc88 is not online. isc88
Joined: 30 May 2013
Total Posts: 27545
23 Sep 2015 05:48 PM
...bump...


what siggy
Report Abuse
isc88 is not online. isc88
Joined: 30 May 2013
Total Posts: 27545
23 Sep 2015 05:54 PM
._.


what siggy
Report Abuse
isc88 is not online. isc88
Joined: 30 May 2013
Total Posts: 27545
23 Sep 2015 06:01 PM
...


what siggy
Report Abuse
isc88 is not online. isc88
Joined: 30 May 2013
Total Posts: 27545
23 Sep 2015 06:09 PM
pls


what siggy
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image