Code:
wait(4) script.Parent.Ferid.OnServerEvent:Connect(function(Player, Mouse) local maxrange = 100 script.Parent.Parent.Parent.Data.Tries.Value = script.Parent.Parent.Parent.Data.Tries.Value + 50 local AlreadyTouched = false local Character = Player.Character or Player.CharacterAdded:wait() local torso = Character.UpperTorso local Shower = game.ReplicatedStorage.FireShower:Clone() Shower.Parent = game.Workspace for i,v in pairs(Shower:GetDescendants()) do if v:IsA("Part") then local ray = Ray.new(Character.HumanoidRootPart.CFrame.p, (Mouse.p - Character.HumanoidRootPart.CFrame.p).Unit * 100) local endPos = ray.Origin + ray.Direction local distance = (Mouse.Position-torso.Position).Magnitude if distance < maxrange then v.CFrame = v.CFrame + Mouse*Vector3.new(Mouse.Position,Mouse.Position,Mouse.Position) else v.CFrame = v.CFrame + endPos end end v.Touched:Connect(function(hit) if hit.Parent.Name ~= nil then local yo = hit.Parent:findFirstChild("Humanoid") if yo == Character.Humanoid then yo.Health = yo.Health - 0 else local tween = game:GetService("TweenService") local boom = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0) local boomprop = {Anchored = true;CanCollide = false;Transparency = 1;Size = Vector3.new(48,48,48) } local ew = tween:Create(v,boom,boomprop) ew:Play() yo.Health = yo.Health - Player.Data.FireDamage.Value wait(1.5) Shower:Destroy() end end end) end end)
In the code above, I tried to make my fire move have an explosion effect whenever it touched something with collision turned on. I didn't make the fire shower itself uncollidable so that it wouldn't malfunction. The question is, whenever I launch the skill, the first 5-6 uses of this the fire shower explodes in the air without touching anything(Doesn't explode immediately after spawning it though). After those 5-6 moves, in the 7+ uses the fire shower bounces off a surface first and after 0.4 seconds or something it'll explode. Why does it behave like that?