So bascially i want to make a grenade with a custom explosion effect, ive managed to figure out how to do it with roblox's basic explosion but idk how to make it custom im not sure if it would be possible to help here but
local tool = script.Parent
local cooldown = 2
local coolingDown = false
local explodesIn = 2
local char
tool.Equipped:Connect(function()
char = tool.Parent
end)
tool.Unequipped:Connect(function()
char = nil
end)
local mouseCF
tool.MouseInfoRE.OnServerEvent:Connect(function(plr, mouseHit)
mouseCF = mouseHit
end)
tool.Activated:Connect(function()
if coolingDown then return end
coolingDown = true
char.Humanoid:LoadAnimation(script.ThrowAnim):Play()
wait(0.1)
local clone = tool.Handle:Clone()
tool.Handle.Transparency = 1
tool.Handle.Trail.Enabled = false
local bv = Instance.new("BodyVelocity")
bv.Velocity = mouseCF.LookVector * 100
bv.Parent = clone
clone.Parent = workspace
clone.CanCollide = true
local explodeCoro = coroutine.wrap(function()
wait(explodesIn)
local explosion = Instance.new("Explosion")
explosion.Position = clone.Position
explosion.Parent = clone
clone.Explosion:Play()
clone.Transparency = 1
clone.Trail.Enabled = false
wait(1)
clone:Destroy()
end)
explodeCoro()
wait(0.1)
bv:Destroy()
wait(cooldown - 0.2)
tool.Handle.Transparency = 0
tool.Handle.Trail.Enabled = true
coolingDown = false
end)
thats the original script
https://gyazo.com/07af5061092f125232aa67ef9f5aee30
thats what i wanna turn into the explosion
