Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Gun giver part script and tool help for gameplay?

Asked by 5 years ago

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.

0
how did you weld the gun? using a script or physical welds? DeceptiveCaster 3761 — 5y
0
Physical weld i belive iNykoda 3 — 5y
0
what weld do i need? iNykoda 3 — 5y
0
Try using the qperfectweld script. namespace25 594 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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

Ad

Answer this question