Hi, how do I make sure that when I make a fireball, that ball doesn’t touch the player or the player’s accessories or hats, is there a way to do that?
Here’s a video.
https://gyazo.com/694a539ad9f2192ea054f50f60a70bf8
Also if you want, I can show you what happens when the player throws a fireball.
Console Output:
CentralPart > FireBlast (x4)
Handle > ShoulderSloth
Handle > Ultra-Fabulous Hair
Handle > Nerd Glasses
Baseplate > Workspace
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > HolidayReefCrown
Handle > PaperHat
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > ShoulderSloth
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > PaperHat
Handle > Ultra-Fabulous Hair
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > PaperHat
Handle > Ultra-Fabulous Hair
Handle > HolidayReefCrown
Handle > ShoulderSloth
Baseplate > Workspace
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > PaperHat
Handle > Ultra-Fabulous Hair
Handle > HolidayReefCrown
Handle > ShoulderSloth
Baseplate > Workspace
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Handle > Ultra-Fabulous Hair
Handle > PaperHat
Handle > HolidayReefCrown
Handle > ShoulderSloth
SpawnLocation > Workspace
Baseplate > Workspace
Handle > Nerd Glasses
Here’s my code if necessary:
-- Services
local replicatedStorage = game:GetService("ReplicatedStorage")
local debris = game:GetService("Debris")
local tweenService = game:GetService("TweenService")
-- Variables
local remoteEvent = replicatedStorage.ElementsRemoteEvents.Fire.FireballRain.FireballRainRemoteEvent
-- Settings
local damage = 10
local serverDebounces = {}
remoteEvent.OnServerEvent:Connect(function(player, playerMouse)
if not serverDebounces[player] then
serverDebounces[player] = true
local character = player.Character or player.CharacterAdded:Wait()
local fireBlastModelClone = replicatedStorage.ElementsModels.Fire.FireBlast:Clone()
fireBlastModelClone.CentralPart.CFrame = character.HumanoidRootPart.CFrame * CFrame.new(0,0,-3)
fireBlastModelClone.FieldPart.CFrame = character.HumanoidRootPart.CFrame * CFrame.new(0,0,-3)
fireBlastModelClone.Parent = workspace
local blastExplosion = fireBlastModelClone.blastExplosionSound
local centralPart = fireBlastModelClone.CentralPart
local fieldPart = fireBlastModelClone.FieldPart
-- Tween Variables
local centralPartGoal = {
Size = Vector3.new(40, 40, 40);
Transparency = 1
}
local fieldPartGoal = {
Size = Vector3.new(45, 45, 45);
Transparency = 1
}
local FCPartsTweenInfo = TweenInfo.new(
3,
Enum.EasingStyle.Quart,
Enum.EasingDirection.Out,
0,
false,
0
)
local centralPartTween = tweenService:Create(centralPart, FCPartsTweenInfo, centralPartGoal)
local fieldPartTween = tweenService:Create(fieldPart, FCPartsTweenInfo, fieldPartGoal)
local bodyVelocity = Instance.new("BodyVelocity")
bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
bodyVelocity.Velocity = (playerMouse.Position - character.HumanoidRootPart.Position).Unit * 40
bodyVelocity.Parent = centralPart
local bodyVelocityTwo = Instance.new("BodyVelocity")
bodyVelocityTwo.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
bodyVelocityTwo.Velocity = (playerMouse.Position - character.HumanoidRootPart.Position).Unit * 40
bodyVelocityTwo.Parent = fieldPart
serverDebounces[player] = false
debris:AddItem(fireBlastModelClone, 10)
local debounce = true
fireBlastModelClone.FieldPart.Touched:Connect(function(h)
if h.Parent:FindFirstChild("Humanoid") and h.Parent.Name ~= player.Name and debounce then
debounce = false
local enemy = h.Parent.Humanoid
enemy:TakeDamage(damage)
bodyVelocity.Velocity = Vector3.new(0, 0, 0)
bodyVelocityTwo.Velocity = Vector3.new(0, 0, 0)
centralPart.fireParticles:Destroy()
blastExplosion:Play()
centralPartTween:Play()
fieldPartTween:Play()
wait(3)
fireBlastModelClone:Destroy()
debounce = true
else if h.Parent.Name ~= player.Name or h.Parent:IsA("Accessory") and h.Parent.Name ~= fireBlastModelClone.Name and debounce then
debounce = false
bodyVelocity.Velocity = Vector3.new(0, 0, 0)
bodyVelocityTwo.Velocity = Vector3.new(0, 0, 0)
blastExplosion:Play()
centralPartTween:Play()
fieldPartTween:Play()
print("".. h.Name .." > ".. h.Parent.Name)
wait(3)
fireBlastModelClone:Destroy()
debounce = true
end
end
end)
end
end)
Ignore the baseplate thing, that’s correct, but the handler is not correct, you can see the parent of the handler, example: Part > Workspace
Also, any way to fix if the fireball explodes when he self touches, example central part is a fireball part, then the fireball is touching it and I dont want that.
Please help, thanks!