http://www.roblox.com/Tool-testing-place?id=179683718
When you equip the tool and Unequip while moving it like stays back.
is there any way to make it move back to the player every time you equip it?
Thanks,
Exsius ;)
I tried to use a CFrame code to bring in back to the player but it wont work
Tool = script.Parent --WepFix = Tool.Gun Ignore Head = script.Parent.Parent.Parent.Character.Head Tool.Equipped:connect(function(mouse) script.Parent.Gun.C0 = CFrame.new() script.Parent.Gun.C1 = CFrame.new(0, 1, 0) * CFrame.Angles(0,0, 0) --Cframe script.Parent.Gun.Anchored = false weld = Instance.new("Weld") weld.Part0 = Head weld.C0 = Head.CFrame:inverse() weld.Part1 = script.Parent.Gun weld.C1 = script.Parent.Gun.CFrame:inverse() weld.Parent = script.Parent wait(1) end)
Try this out:
local Tool=script.Parent local Player=game.Players:FindFirstChild(Tool.Parent.Name) or Tool.Parent.Parent local Head=Player.Character.Head local Gun=script.Parent.Gun function Weld() local W=Gun:FindFirstChild("GunWeld") if W then W:destroy() end Gun.Anchored=true Head.Anchored=true local Weld=Instance.new("Weld",Gun) Weld.Name="GunWeld" Weld.Part0=Head Weld.Part1=Gun Weld.C0=Head.CFrame:inverse() Weld.C1=Gun.CFrame:inverse() Gun.Anchored=false Head.Anchored=false end Tool.Equipped:connect(Weld)