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

Tool falling apart when spawned?

Asked by 7 years ago
Edited 7 years ago
    I'm having this annoying issue, I know this isn't script related, but I don't know where else to post this. Answering this will potentially help answer another question I posted here. Basically I'm following the tool building tutorial made by roblox. http://wiki.roblox.com/index.php?title=Tools ... I read here that adding surface welds will cause the tool to fall apart when equipped.

It then tells me to put the join option to always and the surface material for the objects to smooth or smooth no outline. I'm not sure what that would do. Anyways I did as instructed, and the tool fell apart automatically, It wasn't put together. I then added welds regardless, and this time the tool stuck together, but when I tried to un-equip and re-equip it, it fell apart in my hand.

Any help would be appreciated, I know this isn't script related but thanks anyways.
0
Ew don't use a code block when asking questions itsJooJoo 195 — 7y
0
this is a scripting website Warfaresh0t 414 — 7y
0
Yeah, I know and I didnt use code block it just did that. Dekadrachm 50 — 7y
0
It's in a code block. It's disgusting. and this is a scripting website, If you would like to ask about it, ask on Roblox forums. NathanAdhitya 124 — 7y

2 answers

Log in to vote
0
Answered by
deris88 146
7 years ago

Simply use weld script. You can find tons of them but classic scripts are the best!

local weldTo = script.Parent.Handle --ungroup your weapon and put everything in tool and insert this code!
local weldToCf = weldTo.CFrame:inverse()

local parts = {weldTo}

function Weld(parent)
        for _,v in pairs(parent:GetChildren()) do
                if (v:IsA("BasePart") and v ~= weldTo) then
                        local w = Instance.new("Weld")
                        w.Name = "ToolWeld"
                        w.Part0 = weldTo
                        w.Part1 = v
                        w.C0 = weldToCf
                        w.C1 = v.CFrame:inverse()
                        w.Parent = weldTo
                        table.insert(parts, v)
                end
                Weld(v)
        end
end



Weld(script.Parent)

for _,v in pairs(parts) do
        v.Anchored = false
end

script:Destroy()
0
Thank you, the tutorial I followed made it seem like you needed no scripting to do this. Dekadrachm 50 — 7y
Ad
Log in to vote
1
Answered by
FiredDusk 1466 Moderation Voter
7 years ago

I have one work for you, "Weld".

Answer this question