I need feedback on my first ability

Howdy! This is my first post on the DevForum.

So recently I made an ability that stuns players. (Similar to soulshatters’ XSans knife 4)
Here’s the animation:

And here’s the script:

AFM:PlayAnimation(Player) --Plays animation
			local PlayerCharacter = Player.Character
			if PlayerCharacter ~= nil then
				local PlayerHum = PlayerCharacter:FindFirstChild("Humanoid")
				if PlayerHum ~= nil then
					local AnimationC = Instance.new("Animation", PlayerCharacter)
					AnimationC.AnimationId = "rbxassetid://7848254464"
					local anim = PlayerHum:LoadAnimation(AnimationC)
					anim:Play() --Plays stabbing animation
					local Handle = Tool.Handle
					local touched = false
					wait(.13)
					Handle.Touched:Connect(function(hit)
					if touched == false then
					if hit.Parent:IsA("Model") then
						local hum = hit.Parent:FindFirstChild("Humanoid") --Determine if it was an player/NPC or not
								if hum then
									if anim.IsPlaying == true then
									touched = true
										if touched == true then
											anim:Stop() --Stops the stabbing animation to play the full animation
											local AnimationD = Instance.new("Animation", PlayerCharacter)
											AnimationD.AnimationId = "rbxassetid://7850027297"
											local anim2 = PlayerHum:LoadAnimation(AnimationD)
											anim2:Play() -- Full animation
											Handle.SwordHit:Play()
											local weld = Instance.new("Weld", Handle)
											weld.Part0 = Handle
											weld.Part1 = hit.Parent.Torso --To stick the oponent to the handle
											local e1 = game.ReplicatedStorage.errors:Clone()
											local e2 = game.ReplicatedStorage.errors2:Clone()
											local stunned = false
											e1.Parent = hit.Parent.Head
											e2.Parent = hit.Parent.Head
											stunned = true
											hit.Parent.Humanoid.WalkSpeed = 0 --Stun
											hit.Parent.Humanoid.JumpPower = 0 --Stun
											wait(0.95)
											hum:TakeDamage(20)
											local shock = script.Parent.Parent.Shock:Clone()
											shock.Parent = workspace
											shock:SetPrimaryPartCFrame(PlayerCharacter:FindFirstChild("Left Leg").CFrame) --Shockwave
											weld:Destroy()	
											local sound = Handle.GroundHit
											sound:Play()
											wait(1)
											shock:Destroy()
											wait(4)
											e1:Destroy()
											e2:Destroy()
											stunned = false
											hit.Parent.Humanoid.WalkSpeed = 16 --Removes stun
											hit.Parent.Humanoid.JumpPower = 7.2 
										end
									end
								end
							end
						end
					end)
				end
			end

I’m still a rookie to scripting so it might be garbage.

7 Likes

Wow that’s so cool and smooth.Honestly, I really like when the red explosion effect appears.

Keep it up! :happy4:

3 Likes

Thanks!

I’ll try adding more effects like some rocks explosion

1 Like

I like it, you could tween the effect coming out of the ground instead of it appearing like that.

1 Like

Hmm I would try that
Thanks for the feedback btw

I recommend making the effect client-sided, but good work!

I love this, too good for someone that is new to making abilities. Keep it up! :cool:

1 Like

I can’t make it client sided, because I need the whole server seeing it

Can’t you use :FireAllClients() though?

Thanks for the feedback! I’ll try my best! :smile:

The ability is handled through server scripts so I don’t need to use FireAllClients()

It looks amazing! I love overboard things like these, it makes things look more “epic” in a sense. Though one thing, the red X that keeps appearing on the Dummy’s head when it’s on the ground is weird. It’s bigger than the others, and it keeps flashing. Is that intended or is it a bug? Other than that, love it!

1 Like

It’s intended as a reference to Underverse

You should use FireAllClients() to make it more performance and smoother, just handle the hitbox and damage serverside. Also you could tween the effect size and transparency for more smothness.

You should make the effects fade in and out instead of just appearing and disappearing.
Also making them spin would help make it looks like something is happening instead of a explosion being frozen in time.

1 Like