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.
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
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)
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?