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

Welding with a server event function, wtf am I doing?

Asked by
Raeso 5
5 years ago
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player)
        if  player.Character.Humanoid.Health >= 100 then
        local anvil1 = Instance.new("Part")
        local anvil2 = Instance.new("Part")
        local anvilweld1 = Instance.new("Weld")
        anvilweld1.Part0 = anvil1
        anvilweld1.Part1 = anvil2
        anvilweld1.C0 = anvil1.CFrame
        anvilweld1.C0 = anvil2.CFrame
        anvilweld1.Parent = anvil2
        anvil2.CFrame = anvil1.CFrame * CFrame.new(5, 5, 5)
        anvil1.Parent = game.Workspace
        anvil2.Parent = game.Workspace
        anvil1.CFrame = player.Character.Head.CFrame * CFrame.new(0, 10, 0)
        anvil1.Velocity = Vector3.new(0, -50, 0)

Was trying to figure out how welding works in general, ended up having no clue what I did, but managed to weld anvil1 and 2 inside each other, but cant change the position of anvil2, if that's actually what I did. Need help figuring out how this actually works lol.

0
anvil1.C0 = anvil1.CFrame:toObjectSpace(anvil2.CFrame) will weld anvil2 at it's current offset from anvil1 Vulkarin 581 — 5y

Answer this question