I’m making a grab move, And I want the Enemy Player hit by the player to be welded to the other player or Infront of the player facing the player. Unable to move or rotate.
And after a set amount of time They become able to rotate again and move.
I’m conflicted on using welds because last time I used a weld and it worked when the player would die to the move the Attacking player would die too.
current script:
CombatEvent.OnServerEvent:Connect(function(player, move, contact, variant, extra, track)
local weld = Instance.new("Motor6D")
local hitlist = {}
local human = player.Character:FindFirstChildOfClass("Humanoid")
if move == 'Pierce' then
for _,hit in contact do
local EChar = hit:FindFirstAncestorWhichIsA("Model")
local EHum = EChar:FindFirstChildOfClass("Humanoid")
local EPlayer = Players:GetPlayerFromCharacter(EChar)
if not table.find(hitlist, EHum) then
table.insert(hitlist, EHum)
if IsParrying[EChar] then
print("bruh")
CombatEvent:FireClient(player, 'Stun', 3)
FXHandling.handleAnimations(human, 'rbxassetid://18536944892')
elseif IsBlocking[EChar] then
IFrames[EChar] = true
IFrames[player.Character] = true
if extra == 'First' then
human.WalkSpeed = 0
weld = Instance.new("Motor6D")
weld.Parent = EChar
weld.Part0 = EChar.PrimaryPart
weld.Part1 = player.Character.PrimaryPart
weld.C0 = player.Character.PrimaryPart.CFrame * CFrame.new(0,0,-2)
elseif extra == 'Last' then
human.WalkSpeed = 13
task.wait(0.5)
IFrames[EChar] = false
IFrames[player.Character] = false
end
if variant == 'Slice' then
FXHandling.handleSound('rbxassetid://5101395394', 0.2, 1.4, EChar)
elseif variant == 'Punch' then
FXHandling.handleSound('rbxassetid://743886825', 0.4, 1.2, EChar)
end
EHum:TakeDamage(math.random(3,5))
if EPlayer ~= nil then
CombatEvent:FireClient(EPlayer, 'Stun', 1.5)
end
elseif not IsParrying[EChar] and not IsBlocking[EChar] then
IFrames[EChar] = true
IFrames[player.Character] = true
if extra == 'First' then
human.WalkSpeed = 0
weld.Parent = EChar
weld.Part0 = EChar.PrimaryPart
weld.Part1 = player.Character.PrimaryPart
weld.C0 = player.Character.PrimaryPart.CFrame * CFrame.new(0,0,-2)
elseif extra == 'Last' then
human.WalkSpeed = 13
weld:Destroy()
IFrames[EChar] = false
IFrames[player.Character] = false
end
if variant == 'Slice' then
FXHandling.handleSound('rbxassetid://5101395394', 0.2, 1.4, EChar)
elseif variant == 'Punch' then
FXHandling.handleSound('rbxassetid://743886825', 0.4, 1.2, EChar)
end
EHum:TakeDamage(math.random(3,5))
if EPlayer ~= nil then
CombatEvent:FireClient(EPlayer, 'Stun', 1.5)
end
weld:Destroy()
end
end
end
end
end)
YOU MAY SPOT A FEW ISSUES, THIS IS VERSION 1 OF THE MOVE IM JUST TESTING IT OUT FOR NOW, THOUGH IF YOU SEE ANYTHING YOU’D LIKE TO SUGGEST I’D CHANGE, FEEL UTMOST FREE TO SHARE KNOWLEDGE