Gun disappear after few seconds when eqquiped

Yes. It should now work. The gun may be oriented or positioned incorrectly, in which you should try adjusting the GripForward, GripRight, and GripUp properties.

Personally, I have never used them, so go check them out in the Roblox documentation site: Tool | Roblox Creator Documentation


but it still didn’t work

Can you send a video of how the gun disappears?

1 Like

Alright, I rechecked the code. This in particular looks incorrect:

Character.DescendantAdded:Connect(function(Obj)
	if Obj:IsA("Weld") and Obj.Name == "RightGrip" then
		task.wait()
		Obj.Part0 = ViewModel[Obj.Part0.Name]
	end
end)

I’ve seen one DevForum post, which may have a similar issue. Try duplicating the weapon instead to the ViewModel, and weld that clone to the ViewModel’s hand, maybe?

How do I write the code?

30303030303030030303

Character.DescendantAdded:Connect(function(Obj)
	if Obj:IsA("Weld") and Obj.Name == "RightGrip" then
		local NewGrip = Obj:Clone()
		local TargetPart = Obj.Part1:Clone()
		local NewParent = ViewModel[Obj.Part0.Name]
		
		Obj.Parent = NewParent
		TargetPart = ViewModel
		
		Obj.Part0 = NewParent
		Obj.Part1 = TargetPart
	end
end)

This isn’t tested. Let me know if it works or not.

1 Like

Roblox Keep broken ugh! :confused:


303030303

drag the game tab out might fix it
if the view is invis

1 Like

image
It’s not working + the gun is still disappearing

I tried. Eventually, I go do the Roblox Studio registry method and I think it works.

I may have forgotten to add TargetPart.Parent = ViewModel.

Character.DescendantAdded:Connect(function(Obj)
	if Obj:IsA("Weld") and Obj.Name == "RightGrip" then
		local NewGrip = Obj:Clone()
		local TargetPart = Obj.Part1:Clone()
		local NewParent = ViewModel[Obj.Part0.Name]
		
		Obj.Parent = NewParent
		TargetPart.Parent = ViewModel
		
		Obj.Part0 = NewParent
		Obj.Part1 = TargetPart
	end
end)

About the gun problem, I have run out of ideas. Sorry about that.

1 Like

instead of task.wait() use wait()

Character.DescendantAdded:Connect(function(Obj)
	if Obj:IsA("Weld") and Obj.Name == "RightGrip" then
		wait()
		Obj.Part0 = ViewModel[Obj.Part0.Name]
	end
end)

task.wait() is a new, and faster version of wait().


303030000000000000000000000000000

WAIT GUYS! wait() works! My gun is staying in the game!!!

but when you use task.wait() it doesn’t wait the weld to replicate so you should use wait()

@Y_VRN Thank you so much too for trying to help me solve problem!

1 Like

The weld is already replicated when DescendantAdded is fired. Using either task.wait() or wait() has no difference other that performance improvements.

like this quote said

I’m not sure why task.wait() could break the tool if you use it