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

RightHand Hitbox gets stuck to the ground?

Asked by
Jirozu 71
7 years ago

This hit box script that is supposed to weld to the player's right hand (r15), it works when i stay still on the spawnbox, but when i move around it gets stuck to game's workspace, any help?

--\\Create Hitbox
        local Hitbox = Instance.new("Part", game.Workspace)
        Hitbox.Size = Vector3.new(1, 1, 1)
        Hitbox.BrickColor = BrickColor.new("Bright red")
        Hitbox.Anchored = false
        Hitbox.CanCollide = false

        local Weld = Instance.new("Weld", Hitbox)
        Weld.Part0 = Hitbox
        Weld.Part1 = Character.RightHand
        Weld.C0 = Weld.C0 * CFrame.new(0, 0, 0)
0
"stuck to game's workspace" What? cabbler 1942 — 7y

1 answer

Log in to vote
3
Answered by 7 years ago

That's because you made the parent apart of the workspace, make the parent of the part the player:

--\\Create Hitbox
        local Hitbox = Instance.new("Part", Character)
        Hitbox.Size = Vector3.new(1, 1, 1)
        Hitbox.BrickColor = BrickColor.new("Bright red")
        Hitbox.Anchored = false
        Hitbox.CanCollide = false

        local Weld = Instance.new("Weld", Hitbox)
        Weld.Part0 = Hitbox
        Weld.Part1 = Character.RightHand
        Weld.C0 = Weld.C0 * CFrame.new(0,
0
Happy i helped :) KinqAustinn 293 — 7y
Ad

Answer this question