You can write your topic however you want, but you need to answer these questions:
So pretty much you open a portal you pull the sword from the portal dash forward while slashing, and I feel like the hitbox could be done in a better way.
the animation isnt syncing right for other players it only looks correct for you on your screen.
I am not even sure what solution to try at this point.
asevent.OnServerEvent:Connect(function(plyr,hr,hum,ps1,ps2)
hum:SetAttribute("Busy",true)
local np2 = np:FindFirstChild("NoobsPortal").Parent:FindFirstChild("Portal2"):Clone()
np2.CanCollide = false
np2.Parent = hr.Parent
np2.CFrame = CFrame.new(hr.Position+hr.CFrame.RightVector*5)
np2.CFrame = CFrame.new(np2.Position,hr.Position)
game:GetService("Debris"):AddItem(np2,0.7)
spawn(function()
local tweeninfo = TweenInfo.new(0.3, Enum.EasingStyle.Linear, Enum.EasingDirection.In)
while np2 do
ts:Create(np2, tweeninfo, {CFrame = np2.CFrame * CFrame.Angles(0, 0, math.rad(180))}):Play()
wait(0.3)
end
end)
local tweeninfo = TweenInfo.new(0.2, Enum.EasingStyle.Linear, Enum.EasingDirection.In)
local hitbox = true
ts:Create(np2, tweeninfo, {Size = np2.Size + Vector3.new(7,7,0)}):Play()
local as2 = as:Clone()
as2.Parent = hr.Parent
local maxdis = math.huge
local hitboxtable = {}
local deb = false
spawn(function()
while wait() do
if hitbox and deb == false then
for i,v in pairs(game.Workspace:GetDescendants()) do
if v:IsA("Humanoid") and v.Health > 0 and v.Parent ~= hum.Parent and not v.Parent:FindFirstChild("PortalSwordHit") then
local dis = (as2.Blade2.Position - v.Parent:findFirstChild("HumanoidRootPart").Position).Magnitude
if dis < maxdis and dis <= 10 then
v:TakeDamage(20)
local der = Instance.new("BoolValue",v.Parent)
der.Name = "PortalSwordHit"
game:GetService("Debris"):AddItem(der,0.5)
deb = false
dis = math.huge
end
end
end
elseif not hitbox then
break;
end
end
end)
local loadps1 = hum:LoadAnimation(ps1)
loadps1:Play()
wait(0.1)
loadps1.Stopped:connect(function()
wait(0.05)
as2:Destroy()
hitbox = false
hum:SetAttribute("Busy",false)
end)
local att = Instance.new("Motor6D")
att.Parent = plyr.Character.RightHand
att.Part0 = plyr.Character.RightHand
att.Part1 = as2.Handle1
att.MaxVelocity = 1000000
att.DesiredAngle = 3
wait(0.05)
att.C0 = CFrame.new(0,-0.3,0)*CFrame.Angles(math.rad(90),math.rad(90),0)
att.DesiredAngle = 3
local bv = Instance.new("BodyVelocity",hr)
bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
bv.Velocity = hr.Parent.PrimaryPart.CFrame.LookVector * 80
local bg = Instance.new("BodyGyro",hr)
bg.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
bg.P = 900
bg.CFrame = CFrame.new(hr.CFrame.LookVector)
game:GetService("Debris"):AddItem(bv,0.2)
game:GetService("Debris"):AddItem(bg,0.2)
end)