#Welding

1 messages · Page 1 of 1 (latest)

patent turtle
#

How do i use weld?? Im trying to make the enemy positioned infront of the player and turn towards them but this just welds them into eachother.

desert narwhalBOT
#

studio** You are now Level 2! **studio

fallen wyvern
#

wait no

#

im stupid

#

i read it wrong mb

#

give me a moment to remember

patent turtle
#

its a server side script to handle the hit detection i can give the local script if needed

fallen wyvern
#

i swear ive done smth like this before

patent turtle
#

the C0 and C1 stuff confuses me

fallen wyvern
#

im sorry if im slow

#

its just im a lil bit dyslexic

patent turtle
#

its ok i cant figure it out on my own and the documents arent helping crying

fallen wyvern
#

so for C1 its the cframe of part1

#

u could do smth like CFrame.new(0,0,-5) or smth

#

to have the enemy be infront of the player

patent turtle
#

for C1?

fallen wyvern
#

ye

#

i tried revisiting my old code to fix this

#

but its scuffed

patent turtle
#

O it got them infront but now the lookat doesnt work

#

they face the same way

fallen wyvern
#

oh

desert narwhalBOT
#

studio** You are now Level 5! **studio

fallen wyvern
#

i think you can do

#

weld.c1 = CFrame.Angles(x,y,z)

patent turtle
#

would x,y,z stay like that or is it 0, 0, -5 also

fallen wyvern
#

you have to rotate it like 180 on one of the axis

#

to make them face the player correctly

#

actually i think you can do

weld.C1 = CFrame.new(0,0,-5)*Cframe.Angles(0,0,0)

#

you can change the -5 to whatever distance and for the CFrame.Angles you have to use math.rad(number)

#

for the axis that you're trying to rotate

patent turtle
#

for some reason instead of going 180 to face the enemy it goes diagonal

#

maybe the lookat is messing with it

fallen wyvern
#

hm

patent turtle
#

thats what it looks like

fallen wyvern
#

thats odd

patent turtle
#

This is what my script looks like rn

grab.OnServerEvent:Connect(function(plr, enemy)

local plrhrp = plr.Character:WaitForChild("HumanoidRootPart")
local enemyhrp = enemy:WaitForChild("HumanoidRootPart")


enemyhrp.CFrame = CFrame.lookAt(enemyhrp.Position, plrhrp.Position)


local weld = Instance.new("Weld")
weld.Part0 = plrhrp
weld.Part1 = enemyhrp
weld.Parent = enemyhrp
weld.C0 =  CFrame.new()
weld.C1 = CFrame.new(0,0,-5)* CFrame.Angles(0,180,0)

end)

fallen wyvern
#

maybe change the parent to be the plrs hrp?

#

idk if that will affect anything

#

but

#

we gotta try everything yk

patent turtle
#

parent of weld right?

#

still has same effect

fallen wyvern
#

so odd

#

try to anchor the hrp of the player

patent turtle
#

Wait i think it worked

fallen wyvern
#

rlly?

patent turtle
#

Yea, only that they can move around with shiftlock but that should be manageable

fallen wyvern
#

o

patent turtle
#

Ty tho

fallen wyvern
#

np

#

also

#

humanoid.AutoRotate = false

#

for the shiftlock thing

patent turtle
#

Yup it worked ty very much

thin torrent
#

So basically

#

Nvm its fixed