#Moving hitbox

1 messages · Page 1 of 1 (latest)

regal cove
#

Hi guys anyone have a script for a moving hitbox I need a reference. I’ve tried some things and I have made myself a hitbox. But I just can’t make a moving hitbox without any glitches. Anyone got some suggestions or ideas (a script)? 🙏

pulsar scaffold
#

I am pretty sure there is a post on DevForum is explaining how.

#

And also, a hitbox is basically making a part that's acts like a hitbox

regal cove
tall star
#

Script.paremt

regal cove
#

Anyone got more ideas?

regal cove
pulsar scaffold
tall star
regal cove
pulsar scaffold
regal cove
pulsar scaffold
#

I can't imagine that you would actual fall for it

pulsar scaffold
regal cove
#

I’ve tried welds

#

Moter 6D

#

But it just gives bugs

pulsar scaffold
#

Then how do you not know how to use hitboxs then.

#

That's just odd.

regal cove
#

bro

#

Yesterday

pulsar scaffold
#

Send me your code.

regal cove
#

Alright

#

Hold on opening my pc

#

wait imma show you most of the scritp

regal cove
#

UIS.InputBegan:Connect(function(I,E) -- checkt of je niet aan het typen bent in de chat
if I.KeyCode == Enum.KeyCode.Three then -- nu gaat er iets gebeuren als je muis 1 clikt
if E then return end
if character:FindFirstChild("Stunned") then return end
if special2cooldown == false then

        game.ReplicatedStorage.MainEvent:FireServer("three")
        
        Tornado:play()


        wait(0.65)

        special2cooldown = true
        wait(1)
        special2cooldown = false

    end
end

end

#

and then i got

pulsar scaffold
#

You aren't using the task.libray.

regal cove
pulsar scaffold
#

I highly recommened you use that.

regal cove
#

does that make a big difference?

#

alright ill check into that then

pulsar scaffold
regal cove
#

and for the server script i got this:

#

elseif Argument == "three" then
spawn(function()
plr.Character.Humanoid.WalkSpeed = 16 -- zorgt voor een stun nadat je hebt geslagen
task.wait(0.1)
plr.Character.Humanoid.WalkSpeed = 16
end)

            local hrp = plr.Character:FindFirstChild("HumanoidRootPart")

            local hitbox = Instance.new("Part")
            hitbox.Anchored = false
            hitbox.Size = Vector3.new(5, 10, 5)
            hitbox.Transparency = 0.5
            hitbox.BrickColor = BrickColor.new("Really red")
            hitbox.CanCollide = false
            hitbox.CFrame = hrp.RootAttachment.WorldCFrame
            hitbox.Parent = workspace  -- altijd in Workspace voor physics stabiliteit

            -- WeldConstraint zodat hij meebeweegt
            local weld = Instance.new("WeldConstraint")
            weld.Part0 = hitbox
            weld.Part1 = hrp
            weld.Parent = hitbox
                    
            game.Debris:AddItem(hitbox, 1)
            
            local WaterTornadoVFX = game.ReplicatedStorage.VFX.WaterTornadoVFX:Clone()


            local rootAttachment = hrp:FindFirstChild("RootAttachment")

            spawnVFX(game.ReplicatedStorage.VFX.WaterTornadoVFX, hrp.CFrame)
pulsar scaffold
regal cove
#

local hitboxcooldown = false
hitbox.Touched:Connect(function(hit)
if hit.Parent ~= plr.Character and hit.Parent:FindFirstChild("Humanoid") then
if hitboxcooldown == true then return end
hitboxcooldown = true

                    hit.Parent:FindFirstChild("Humanoid"):TakeDamage(10)

                    if cooldown == true then return end
                    if lastcooldown == true then return end

                    spawn(function()
                        cooldown = true
                        cooldown = false
                    end)


                    local BV = Instance.new("BodyVelocity")
                    BV.MaxForce, BV.Velocity = Vector3.new(5e4, 5e2, 5e4), plr.Character.HumanoidRootPart.CFrame.LookVector * 10
                    BV.Parent = hit.Parent.HumanoidRootPart
                    game.Debris:AddItem(BV, 0.16)

                    local bool = Instance.new("BoolValue") -- dit geeft een boolvalue aan de enemy, die stun heet
                    bool.Name = "Stunned"
                    bool.Parent = hit.Parent
                    game.Debris:AddItem(bool,1)

                    task.wait(1) -- !nog wellicht veranderen
                    hitboxcooldown = false
                    wait(5)
                    if hitbox then
                        hitbox:Destroy()
                    end
                end
            end)
        end
    end)
regal cove
pulsar scaffold
#

task.wait()

#

task.spawn()

#

task.defer()

regal cove
#

ohw okay okay

pulsar scaffold
#

task.wait(1)?

#

You are using it now?

#

And why are there many comments

regal cove
#

for my self man

#

just wanting to know what does what

#

for easy editing

#

and still learning

pulsar scaffold
#

Okay, it is generally a good practice when you are in a team, but sure.

#

And I don't recommend you learn scripting in youtube.

#

I will suggest you a really good course.

regal cove
#

sure man thx

pulsar scaffold
#

It will make you from beginner to pro.

regal cove
#

uuh

#

free?

pulsar scaffold
#

It's paid but you can get a discount.

regal cove
#

okay

#

but

#

can you help me with the code

pulsar scaffold
#

When you want to create a hitbox.

#

You need to create an Instance

#

Like this: Instance.new()

regal cove
#

i know

pulsar scaffold
#

Inside of the params add "Part"

regal cove
#

instance.new("Part")

pulsar scaffold
#

Set the size to what ever you like

regal cove
#

look in the code

#

i did

pulsar scaffold
#

And the positon should be set to the tools handle

#

And check the Vectors positon a little bit forward

#

And get the players mouse

regal cove
#

i want the position to the character

#

so plr.Character.HumanoidRootPart

#

i did that

#

everything

#

i even tried allign position

#

but that is to slow

#

even with max power

#

@pulsar scaffold you there?

regal cove
#

found a easy fix