Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is it possible to make a stun when i use my fireball?

I tried making a stun for my Fireball aka when my fireball hits someone it stuns them and I couldnt seem to do it. I know i would have to do like

hum.WalkSpeed = 0
hum.JumpPower = 0

and smt smt but if i do that I wouldn't be able to move again. and plus i want to add particles to my stun.

2 answers

✓ Accepted answer

All you really have to do is the script you have inside the fireballs script: (Keep in mind this is written like you have a "local FireBall", "local Dmg", and "local StunTime" set)

FireBall.Touched:Connect(function(hit)
	local hum = Hit.Parent:FindFirstChild("Humanoid")
	if hum then
		hum:TakeDamage(Dmg)
		hum.WalkSpeed = 0
		hum.JumpPower = 0
		hum.PlatformStand = true
		wait(StunTime)
		hum.WalkSpeed = 16
		hum.JumpPower = 50
		hum.PlatformStand = false
		hum.Jump = true
	end
end)

Thats simple. Untested though so if it doesnt work just tell me

5 comments

0

that is, unless you want to do an actual "stun" action, where the character vibrates...

0

yes I actually want the actual "stun" action when the character vibrates and this is ok too. so players in my game can actually noticed that the person is stunned and also What about the particle emitter?

0

That can be put in the tool and once the touch happens you just need to clone the partical emmiter acivate the clone emmiter and then destroy it after about a second

0

My fireball isn't a tool. It's a keybind. add me on discord talon#6473 so we can talk more.

0

kk

this is my script

--// Services \\--
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Debris = game:GetService('Debris')

--// Variables \\--
local Remote = ReplicatedStorage.Storage.RemoteEvents.FireBallEvent
local FlameShot = ReplicatedStorage.FlameShot

--// Settings \\--
local Damage = 30

Cooldown = 10

local ServerDebounces = {}

Remote.OnServerEvent:Connect(function(plr, Mouse)
 if not ServerDebounces[plr] then
  ServerDebounces[plr] = true
  
  local Char = plr.Character or plr.CharacterAdded:Wait()
 
  local FlameShotClone = FlameShot:Clone()
  FlameShotClone.CFrame = Char.HumanoidRootPart.CFrame * CFrame.new(0,0,-3)
  FlameShotClone.Parent = workspace
 
  local BodyVelocity = Instance.new("BodyVelocity")
  BodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  BodyVelocity.Velocity = Mouse.lookVector
  BodyVelocity.Parent = FlameShotClone
 
  spawn(function()
   for i = 0, 1000 do
    wait()
    FlameShotClone.Size = FlameShotClone.Size + Vector3.new(0.07,0.07,0.07)
    BodyVelocity.Velocity = Mouse.lookVector*i
   end
  end)
  ServerDebounces[plr] = false
  Debris:AddItem(FlameShotClone, 10)
 
  local Debounce = true
  FlameShotClone.Touched:Connect(function(h)
   if h.Parent:FindFirstChild('Humanoid') and h.Parent.Name ~= plr.Name and Debounce then   
    Debounce = false   
    local Enemy = h.Parent.Humanoid
    Enemy:TakeDamage(Damage)
    FlameShotClone.Transparency = 1
    BodyVelocity:Destroy()
    FlameShotClone.Effect.Speed = NumberRange.new(8,8)
    wait(10)
    FlameShotClone.Effect.Enabled = false
   FlameShot.Cooldown = true
    wait(10)
    FlameShotClone:Destroy()
    wait(2)
    Debounce = true
   end
  end)
 end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.