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

My welding script isnt working. Character is turning, What is wrong?

Asked by 5 years ago

Everytime the script plays my character turns sideways and stops moving.

local UIS = game:GetService("UserInputService")
local player = game.Players.LocalPlayer


UIS.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 then
        local ball1 = Instance.new("Part", workspace)
        ball1.Anchored = true
        ball1.CanCollide = false
        ball1.BrickColor = BrickColor.Blue()
        ball1.Material = "Neon"
        ball1.Shape = "Ball"
        ball1.Size = Vector3.new(2,2,2)

        -- Connecting to Hand;

        local weld = Instance.new("Weld", ball1)
        weld.Part0 = player.Character:WaitForChild("LeftHand")
        weld.Part1 = ball1
        weld.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0, 0, 0)
    end
end)

1 answer

Log in to vote
1
Answered by 5 years ago

It's probably because of the ball1.Anchored (line 8) or the CFrame (line 20) or maybe both.

0
Thx so much OnlineSaiyan 28 — 5y
0
Your welcome. User#22219 20 — 5y
Ad

Answer this question