So I am having problems with using a BindableEvent to fire an explosion when a “projectile” hits something. I tried with “print()” to verify if the function was working. Simply I can’t get the second script (the one waiting for the event to fire) to do anything.
I was using all the scripts I am talking about inside ServerScriptService. MakingExplosion is the first script, firing the event.
The second one is EventHandler, which I was trying to use for waiting the event to fire.
The text “Fired” is printing from MakingExplosion
The text “FIRED” is not printing from EventHandler, even if the event was fired.
I tought about this and maybe I placed the scripts in weird places?
Or I really don’t know.
Btw sorry for my bad english, I’m not usual at it.
.
.
.
Making Explosions
local light = script.Parent
local explosion = game.ServerScriptService.LightWorking.Explosion
local event = script.Event
light.Touched:Connect(function(Hit)
print(Hit)
local owner = script.Parent.Owner
if Hit.Parent.Name ~= owner.Value then
event:Fire(light.Position)
light:Destroy()
print("Fired")
end
end)
EventHandler
local exEvent = game.ServerScriptService.LightWorking.LightPart.MakingExplosion.Event
exEvent.Event:Connect(function(exPosition)
local exPart = game.ServerScriptService.LightWorking.Explosion
local exClone = exPart:Clone()
exClone.Position = exPosition
exClone.Parent = workspace
exClone.Transparency = 0
print("Summoned Explosion")
end)
exEvent.Event:Connect(function()
print(“FIRED!”)
end)