this might be a simple fix, but im stuck on this dumb bug, whenever i spawn the meteor, it works, it moves to the right direction and ye stuff like that but when someone touches it, does it fire? no. so whenever the fireball is touched, it dosent do anything, it just moves forward.
The part of the script(i will not reveal all as i dont want my scripts to be stolen):
--fireball
local fireballdebounce = false
local touchdeb = false
script.Parent.summonfireball.OnServerEvent:Connect(function()
if not fireballdebounce then
fireballdebounce = true
local fireball = Instance.new("Part")
fireball.BrickColor = BrickColor.new("New Yeller")
fireball.Size = Vector3.new(2,2,2)
fireball.Material = Enum.Material.Neon
fireball.Position = script.Parent.Parent.HumanoidRootPart.Position + (script.Parent.Parent.Head.CFrame.LookVector) -- ok
fireball.Parent = game.Workspace
local vl= Instance.new("BodyVelocity")
vl.Parent = fireball
vl.Velocity = Vector3.new(script.Parent.Parent.HumanoidRootPart.CFrame.LookVector.X*50,0,script.Parent.Parent.HumanoidRootPart.CFrame.LookVector.Z*50)
fireball.Name = "FireBall"
fireball.CanTouch = true
fireball.Anchored = false
fireball.Touched:Connect(function(m)
if not touchdeb then
touchdeb = true
m = m.Parent
if m:IsA("Accessory") then
m = m.Parent
end
if m:FindFirstChild("Humanoid") and not m == script.Parent.Parent then
m.Humanoid:TakeDamage(25)
end
task.wait(0.5)
touchdeb = false
end
end)
script.Parent.Handle.glow.Material = Enum.Material.Plastic
game:GetService("Debris"):AddItem(fireball,2)
task.wait(6)
script.Parent.Handle.glow.Material = Enum.Material.Neon
fireballdebounce = false
end
end)
Setting the part to its parent will not work, and may return errors. Try this script:
if not touchdeb then
touchdeb = true
if not m.Parent:IsA("Accessory") and m.Parent:FindFirstChild("Humanoid") then
m.Humanoid:TakeDamage(25)
end
task.wait(0.5)
touchdeb = false
end
It’s because the script won’t detect when it hits something cus the bodyforce.You can instead do region 3 and keep the body force. Heres an example script. Edit everything with your variables and such. Just remove the .Touched:
local Metor = script.Parent
local RegionStats = Region3.new(Metor.Position - Metor.Size/ 2 * 1.25, Metor.Position +Metor.Size / 2 * 1.25)
local Blacklist = OverlapParams.new()
Blacklist.FilterType = Enum.RaycastFilterType.Blacklist
Blacklist.FilterDescendantsInstances = Metor
local Hitbox = workspace:GetPartBoundsInBox(RegionStats.CFrame, RegionStats.Size, Blacklist)
for i,v in pairs(Hitbox) do
--- paste the things in the .touched event here.
end
Whoops I meant clone. If you design the fireball yourself and then put it in server storage you can just clone that into the game instead of instancing the fireball like you have been doing. Lot less code and allows you to customize and make the fireball look better