Okay, so I made a fireball script that essentially burns any player it touches, however when the fireball makes contact with the player, an error shows up in huge quantities, and the player doesn't burn.
Note: The test subject for the fireball is a dummy
Error:12:24:31.510 - Workspace.Dummy.Regenerating Pad.Fire.Spread:7: attempt to perform arithmetic on field 'Size' (a userdata value)
12:24:31.510 - Stack Begin
12:24:31.511 - Script 'Workspace.Dummy.Regenerating Pad.Fire.Spread', Line 7
12:24:31.512 - Stack End
Script:
game.ReplicatedStorage.Fireball.OnServerEvent:connect(function(player, mousehit) local char = game.Players[player.Name].Character local hum = char.Humanoid local root = char.HumanoidRootPart local fireball = Instance.new("Part",workspace) local fire = game:GetService("ServerStorage").Fire fireball.Anchored = false fireball.CFrame = root.CFrame * CFrame.new(0,1,-4) fireball.Size = Vector3.new(2,2,2) fireball.Material = Enum.Material.Neon fireball.BrickColor = BrickColor.new("Deep orange") fireball.Shape = Enum.PartType.Ball fire:Clone().Parent = fireball local bv = Instance.new("BodyVelocity") bv.MaxForce = Vector3.new(1e8,1e8,1e8) bv.Velocity = Vector3.new(0,0,0) bv.Parent = fireball ten = true local tween = game:GetService("TweenService") local tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,10,true,0) local tweenproperty = {Size = Vector3.new(5,5,5)} local tweenrun = tween:Create(fireball,tweeninfo,tweenproperty) tweenrun:Play() bv.Velocity = mousehit.lookVector*50 game.Debris:AddItem(fireball, 10) fireball.Touched:connect(function(hit) if not ten then return end ten = false local ehum = hit.Parent:findFirstChild("Humanoid") or hit.Parent.Parent:findFirstChild("Humanoid") if ehum and ehum ~= hum then fireball.CanCollide = false ehum:TakeDamage(10) local debrisService = game:GetService("Debris") local fire = game:GetService("ServerStorage"):FindFirstChild("Fire") for _, v in pairs(hit.Parent:GetChildren()) do if v:IsA("BasePart") then if not v:FindFirstChild("Fire") then local fireClone = fire:Clone() fireClone.Parent = v debrisService:AddItem(fireClone, 5) -- removes the object in 5 seconds end end end for i = 1, 10 do hit.Parent.Humanoid:TakeDamage(1) wait(0.5) end elseif hit.Parent == char then return nil elseif hit.Anchored == true and hit.CanCollide == true then for i=1,50 do local part = fireball:clone() part.Size = Vector3.new(0.5,0.5,0.5) part.CFrame = fireball.CFrame part.CanCollide = false --part.BodyVelcoity.MaxForce = Vector3.new(1e8,0,1e8) part.Fire.LockedToPart = false part.BodyVelocity.Velocity = Vector3.new(math.random(-30,30),math.random(-30,30),math.random(-30,30)) part.Parent = game.Workspace game.Debris:AddItem(part,1) end fireball:Destroy() ten = true end end) end)
Fire spread script --Made by roblox
function Spread(part) check = part:findFirstChild("Fire") if check == nil then script.Parent:Clone().Parent = part elseif check ~= nil then check.Size = check.Size + 1000000 check.Heat = check.Heat +1000000 end end script.Parent.Parent.Touched:connect(Spread)