You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to be able to weld myself to an enemy and destroy the weld after 0.2 seconds and the enemy will stay infront of me -
What is the issue? Include screenshots / videos if possible!
the enemy will teleport backwards after destroying the weld -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried motor6D, network ownership, and client sided welds
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Heres my code:
if v ~= nil then
for i,p in ipairs(HitVFX:GetDescendants()) do
if p:IsA("ParticleEmitter") then
p:Emit(p:GetAttribute("EmitCount"))
end
end
print(v.Parent)
local weld = Instance.new("WeldConstraint", RootPart)
weld.Part0 = RootPart
weld.Part1 = v.Parent.HumanoidRootPart
local vel = Instance.new("BodyVelocity", v.Parent.Torso)
vel.MaxForce = Vector3.new(1,1,1) * 1000000;
vel.Parent = v.Parent.Torso
vel.Name = "SmallMoveVel"
vel.Velocity = Vector3.new(1,1,1) * Character.HumanoidRootPart.CFrame.LookVector * 50
game.Debris:AddItem(vel, 0.2)
wait(0.2)
weld:Destroy()
--RagDoll.EnableRagdoll(v.Parent, 1)
v.Parent.Humanoid:TakeDamage(Damage)
wait(0.2)
for i,d in pairs(v.Parent:GetDescendants()) do
if d:IsA("BasePart") or d:IsA("MeshPart") then
d:SetNetworkOwner(game.Players:GetPlayerFromCharacter(v.Parent))
d.Massless = false
end
end
else
for i,p in ipairs(HitVFX:GetDescendants()) do
if p:IsA("ParticleEmitter") then
p:Emit(p:GetAttribute("EmitCount"))
end
end
print(v)
local vel = Instance.new("BodyVelocity", Torso)
vel.MaxForce = Vector3.new(1,1,1) * 1000000;
vel.Parent = Torso
vel.Name = "SmallMoveVel"
vel.Velocity = Vector3.new(1,1,1) * Character.HumanoidRootPart.CFrame.LookVector * 50
game.Debris:AddItem(vel, 0.2)
end
end)
Heres a video demo