#Hitbox help

136 messages · Page 1 of 1 (latest)

forest zodiac
#

can u post the script here so i can read and defines wheres the problem?

abstract shore
#

make sure they have CanTouch on or whatever its called

soft plume
soft plume
#

Could it be because the parts are located inside of a tool?

#

They aren't located inside the workspace

#

They are in the tool the player holds

#

@forest zodiac

forest zodiac
# soft plume Hitbox Script ```lua local tool = script.Parent.Parent local Hitbox = script.Hit...

ok so first,u used while true do which is an uncool stuff since its rll buggy,id recommend using runservice for looping

second,can u tell me if u can see the hitbox is rll out the workspace?maybe ur while wait code causes it some glitch

and one more,if ur doing a rotation script thingy dont apply it on hitbox,cuz once again buggy,and if its not a rotating code only call the hitbox's reposition code out once pal

#

overall i cant see any other problems beside whilewait and ur rotating the hitbox

soft plume
#

But I need it to rotate

#

@forest zodiac

forest zodiac
#

why would u want ur hitbox to rotate tho?

#

if u wanna make it like that,id recomment use another type of hitbox statement

#

like :GetPartsInPart()

soft plume
#

Because I'm making tennis

#

And you can swing in two different directions

soft plume
#

I'll send a video later to help explain

forest zodiac
#

ok srr my mom called me

#

ok so,since ur making ur hitbox moving

#

it wouldnt work with touched

#

id recommend using :GetPartsInPart()

#

even tho it returns a table,but thers sometrick to do with it

#

simplest trick is for i,v in pair(game.workspace:GetChildren() do if v.Name = --the table u recived from GetPartsInPart-- then --do stuffs-- end)

#

u should go ahead and search it up,peope explains better than me

#

so in conclusion the solution is to use another hitbox method: :GetPartsInPart

soft plume
#

Okey dokey

#

I'll try later

#

But the hit box is a model, with3 parts inside

#

The middle, which is welded to the hitboxL and hitboxR

#

The two hit ones have a offset to be In front of the play

#

Player

#

So u can't hit the ball when it's behind u

#

That's why I'm using a rotation script

#

And there's 2 because there is two different swings and depending on which hit box it hits u need to swing that why to return the ball

#

Way

#

The model is inside a script inside a folder inside a tool inside the play modrl

next sonnetBOT
#

studio** You are now Level 12! **studio

forest zodiac
#

welp,das a great idea for a game

#

an overaall,ur still rotating the hitbox

#

so the only way is that way i told u lol

soft plume
#

Ok

forest zodiac
#

anyways,gl on ur game bud

#

xd

soft plume
#

Ty

forest zodiac
#

np

soft plume
#

Sry it's confusing

#

I wish I could send screen shot

forest zodiac
#

game.workspace:getchild get every chilfren in the workscpace

#

EVERY

soft plume
#

Ok ty

soft plume
#

and what would i do?

#

local getpartsinpart = model:GetPartsInPart

#

?

#

yea idk how to use this at all

#

where do i put it and how do i implment it and also what does it have to do with a DIFFERENT part not being able to touch it

#

flip it didnt record right

#

ill send vid tmr

#

Cause the hit box follows Me correctly

#

It's just a different doesn't register it hitting it

#

It registers the player touching it

#

But not the hitbox located inside the script inside the players tool

forest zodiac
#

u gotta search it up bro

its rll complicated if u use it for hitbox,cuz as i said getpartsinpart only returns a table of parts that r in them.Just search on how to usr it for hirbox

soft plume
#

@forest zodiac im going for a different aproch becuase i cant find any thing that explains it well so im doing this now: ```local tool = script.Parent.Parent
local Hitbox = script.Hitbox

tool.Equipped:Connect(function()
local playerName = tool.Parent.Name
local playerhitbox = Hitbox:Clone()
playerhitbox.Name = playerName.. "'s Hitbox"
playerhitbox.Parent = workspace
while true do
playerhitbox.Middle.Rotation = tool.Parent.HumanoidRootPart.Orientation
wait()
playerhitbox.Middle.Position = tool.Parent.HumanoidRootPart.Position
end
end)

tool.Unequipped:Connect(function()
local playerName = tool.Parent.Parent.Name
local playerhitbox = workspace:FindFirstChild(playerName .. "'s Hitbox")
playerhitbox:Destroy()
end)

#

but my original welds dont work so idk

#

wait i can use pivot...

#

nvm

#

i cant use that for rotation

#

@forest zodiac pls help

forest zodiac
#

wait why dont u use tween💀

#

i told u while true do isnt effective

#

and u can do an unlimited spinning using tween by just 2 lines

#

it also doesnt lag ur game

forest zodiac
#

but if u want a full example of getpartsinpart

#

hol on

#
local p = ur_hitbox
for i,v in pairs(game.Workspace:GetPartsInPart(p)) do
if v.Parents:FindFirstChild("Humanoid") then
--do stuffs
end
soft plume
#

wait what

#

can you change that so that the players hitbox is located inside the workspace with Playersname.."'s Hitbox"

forest zodiac
#

ye alr

next sonnetBOT
#

studio** You are now Level 7! **studio

forest zodiac
#

put the script inside the character

soft plume
#

inside what character?

forest zodiac
#

startercharacter script

#

startercharactrr

#

and make it

soft plume
#

ok

forest zodiac
#

eh nvm

soft plume
#

continue...

forest zodiac
#

not that

#

put it in ur hitbox

#

srr i thought this is dmg hitbox

#
local p = script.Parent
for i,v in pairs(game.Workspace:GetPartsInPart(p)) do
if v.Parents:FindFirstChild("Humanoid") then
--do stuffs
end
#

welp gtg to school now cya

soft plume
#

wha

#

what time zone r u

#

no workies

forest zodiac
#

it was 6:30 am lol

#

btw did it worked

soft plume
#

No

soft plume
soft plume
#

Ohhh

#

Nvm

#

Yea it doesn't work

forest zodiac
#

k can u tell me any specific thing that only ur ball has

#

or the

#

thing to swing that ball

#

my vocabulary is dum af

#

ok so maybe change ur ball name to "TennisBall"

#

and use this

#
local p = script.Parent
for i,v in pairs(game.Workspace:GetPartsInPart(p)) do
if v.Name == "TennisBall" then
--do stuffs
end
soft plume
#

Part parameter must be BasePart

#

@forest zodiac

forest zodiac
soft plume
#

That's what it says

#

In output

#

I think because the script is inside a model

#

Which holds the parts

forest zodiac
#

welp i didnt used that much

#

ig u should go check on the internet

but for now ill try to help u

#

hol on,might take awhile

soft plume
#

any ideas yet

forest zodiac
#

lol srr for not responding

#

too many school

forest zodiac
soft plume
#

Get parts in part I think

#

The script.parent is a model

#

Does that have anything to do

forest zodiac
#

can u tell me the exact line?

next sonnetBOT
#

studio** You are now Level 8! **studio