Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

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

Asked by 5 years ago

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.

Closed as Not Constructive by EpicMetatableMoment and SerpentineKing

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 5 years ago

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

0
that is, unless you want to do an actual "stun" action, where the character vibrates... DeceptiveCaster 3761 — 5y
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? Penomecco 9 — 5y
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 Protogen_Dev 268 — 5y
0
My fireball isn't a tool. It's a keybind. add me on discord talon#6473 so we can talk more. Penomecco 9 — 5y
0
kk Protogen_Dev 268 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

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)