Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Gun giver part script and tool help for gameplay?

So i got help with a certain script that works. The thing is is that when its in game play the "Gun" falls apart and the tool model gets distorted in placement. I have the part set up as follows:

Part

-ClickDetector

-Gun (tool)

-Script

function hi(x)
     local z = script.Parent.Gun
    z:Clone().Parent = x.Backpack
end

script.Parent.ClickDetector.MouseClick:Connect(hi)

It just falls apart in gameplay. Please help.

5 comments

0

how did you weld the gun? using a script or physical welds?

0

Physical weld i belive

0

what weld do i need?

0

Try using the qperfectweld script.

1 answer

✓ Accepted answer

Revised Script

script.Parent.ClickDetector.MouseClick:Connect(function(x)
	local z = script.Parent.Gun:Clone()
	z.Parent = x.Backpack
end)

So firstly, I revised your script a bit, since you can place the function connect into the same line as the definition.

Secondly, I guess you can try the qweld script as stated in the comments, though you could also try making your tool's internal model into a single MeshPart

INFORMATION = https://developer.roblox.com/api-reference/class/MeshPart

IMPORTING = https://developer.roblox.com/articles/Mesh-Parts

(Can be made using Applications such as Maya or Blender)

suspectshot108 Suggestion: QWeld = https://www.roblox.com/library/181259635/qPerfectionWeld-Perfect-welding-for-EVERY-situat

This discussion is preserved as it was. New answers, comments, and votes are closed.