#Idk how to descript it

1 messages · Page 1 of 1 (latest)

blazing ermine
#

Sooo I made or I am trying to make a Punch script and I am right now at the point where i am making the Hitboxes which should be located where the players hands are but there are not at the lower end of the Arm but in the Middel how would I move them down

the (local) script:

local plr = game.Players.LocalPlayer
local char = plr.Character
local Hum = char:WaitForChild("Humanoid")

local HitboxLeft = Instance.new("Part")
HitboxLeft.Parent = char:WaitForChild("Left Arm")
HitboxLeft.Size = Vector3.new(1,1,1)
local LeftWeld = Instance.new("Weld")
LeftWeld.Parent = HitboxLeft
LeftWeld.Part0 = HitboxLeft
LeftWeld.Part1 = char:WaitForChild("Left Arm")

local HitboxRight = Instance.new("Part")
HitboxRight.Parent = char:WaitForChild("Right Arm")
HitboxRight.Size = Vector3.new(1,1,1)
local RightWeld = Instance.new("Weld")
RightWeld.Parent = HitboxRight
RightWeld.Part0 = HitboxRight
RightWeld.Part1 = char:WaitForChild("Right Arm")
last ether
#

HitboxRight.Position *= Vector3.new(0,1.5,0)

blazing ermine
#

kk thanks

last ether
#

try it first

#

im not sure

blazing ermine
#

na sadly notbut still thanks

last ether
#

uh alr gimme a sec

blazing ermine
#

because the Weld sets the position every like milisecound so it is where the arms are

last ether
#

are you setting the weld every frame?

#

also

#

im pretty sure the r6 character arms have attachments in them

#

go into the arms when youre playing

#

and see if theres an attachment at the position of the hands

blazing ermine
#

yea LeftGripAttackment

#

so the part 1 of my weld is the LeftGripAttackment?

#

Wait I test it

#

it gives the error: Expected BasePart got Attachment for Weld.Part1.

#

so it doesnt works

#

how I tought

blazing ermine
last ether
#

i know there's a hacky way you could do it

blazing ermine
#

wait I could position a part where the attachment is?

last ether
#

yeah

#

part.cframe = attachment.worldcframe

#

i think

#

it will be less optimized than welding thouigh

blazing ermine
#

uhh yea

#

but I try

blazing ermine
last ether
#

you could also use a raycasting module

#

or sorry

#

hitbox module

#
blazing ermine
last ether
#

ic ic

#

oh wait

#

instead of a weld do a weldconstraint

#

and then do the position thing i told you

blazing ermine
last ether
blazing ermine
blazing ermine
last ether
#

does it error?

blazing ermine
#

nope

#
local plr = game.Players.LocalPlayer
local char = plr.Character
local Hum = char:WaitForChild("Humanoid")

local HitboxLeft = Instance.new("Part")
HitboxLeft.Parent = char:WaitForChild("Left Arm")
HitboxLeft.Size = Vector3.new(1,0.2,1)
HitboxLeft.Position *= Vector3.new(0,-40,0)
local LeftWeld = Instance.new("WeldConstraint")
LeftWeld.Parent = HitboxLeft
LeftWeld.Part0 = HitboxLeft
LeftWeld.Part1 = char:WaitForChild("Left Arm")

local HitboxRight = Instance.new("Part")
HitboxRight.Parent = char:WaitForChild("Right Arm")
HitboxRight.Size = Vector3.new(1,0.2,1)
HitboxRight.Position *= Vector3.new(0,-40,0)
local RightWeld = Instance.new("WeldConstraint")
RightWeld.Parent = HitboxRight
RightWeld.Part0 = HitboxRight
RightWeld.Part1 = char:WaitForChild("Right Arm")
``` thats my script rn
#

@last ether

last ether
#

maybe its becasuse youre setting the positino before welding

blazing ermine
#

yea

#

wait

blazing ermine
last ether
blazing ermine
#

yea

blazing ermine
last ether
#

idk then sorry

blazing ermine
#

ok

rich schooner
#

maybe try parenting it last...

#

if not send a .rbxl file that shows the issue

#

i cannt rem if the order of when you parent things effects other things.. I think it does..

last ether
#

you should parent stuff last

blazing ermine
blazing ermine
rich schooner
#

u just save what is needed to ur pc, as a file

blazing ermine
blazing ermine
#

solved

rich schooner
#

@blazing ermine can you let us know what you did to solve it and share the script? Thanks

blazing ermine
#
game.ReplicatedStorage.RE.Punch.OnServerEvent:Connect(function(plr,dmg,attack)
    local char = plr.Character
    local rchb = RaycastHitbox.new(char)

    local Hb = game.ReplicatedStorage:WaitForChild("Hitbox")
    
    local lim = false
    if attack == "left" then
        lim = "Left Arm"
    end
    
    if attack == "right" then
        lim = "Right Arm"
    end
    
    if attack == "rightleg" then
        lim = "Right Leg"
    end

    local Hitbox = Hb:Clone()
    local Weld = Instance.new("Weld")
    Weld.Part0 = Hitbox
    Weld.Part1 = char:WaitForChild(lim)
    Weld.Parent = Hitbox
    Hitbox.Parent = char:WaitForChild(lim)

    local newHitbox = RaycastHitbox.new(Hitbox)

    newHitbox:HitStart()
    
    newHitbox.OnHit:Connect(function(hit, humanoid) 
        if humanoid.parent.Name ~= plr.Name then
        humanoid:TakeDamage(dmg)
        Knockback(char,humanoid.parent)
        end
    end)
    
    wait(0.2)
    newHitbox:HitStop()
    
    Hitbox:Destroy()
    Weld:Destroy()
end)
``` this is the part of the script I moved it now in a server script so everbody can see the hitbox and stuff just so its on the server and you see I just clone an object
#

idk if you know how the raycasthitbox thing works

#