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

Why does my script not rotate my model correctly?

Asked by
Jexpler 63
5 years ago

So I have a script that is supposed to give the player a riot shield. For some reason, the shield is just off on the distance.

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        local rarm = char["Right Arm"]
        local cf = rarm.CFrame
        local p = cf.p
        local x = cf.x
        local y = cf.y
        local z = cf.z
        script.Parent.Parent.PrimaryPart = script.Parent
        script.Parent.Parent:SetPrimaryPartCFrame(cf)
        script.Parent.Parent:SetPrimaryPartCFrame(CFrame.Angles(0, 90, -90))
        local weld = Instance.new("Weld")
        weld.Part0 = char["Right Arm"]
        weld.C0 = char["Right Arm"].CFrame:Inverse()
        weld.Part1 = script.Parent
        weld.C1 = script.Parent.CFrame:Inverse()
        weld.Parent = script.Parent.Parent
    end)
end)
0
math.rad(90) greatneil80 2647 — 5y
0
Where do I put that? Jexpler 63 — 5y
0
CFrame.Angles(0,math.rad(90),0) User#23365 30 — 5y
0
Didn't fix it. Jexpler 63 — 5y

Answer this question