Module Script not firing bindableevent

So im making my module script fire a bindable event to a server script here. but it isnt executing. Module script code:

while true do
        wait()
        local bomb = repStorage.Items.Models.Bomb:Clone()
        bomb.Parent = workspace
        local x = workspace.Map1.Ground.Size.X/2
        local z = workspace.Map1.Ground.Size.Z/2
        bomb.Position = bomb.Position + Vector3.new(math.random(-x, x), 10, math.random(-z, z))
        bomb.Anchored = false

        bomb.spawn:Fire()
        wait(9999) -- Im only spawning 1 bomb right now for testing purposes this will be changed later dont worry
    end

Server script:

local bomb = script.Parent

local spawnEvent = script.Parent.spawn

spawnEvent.Event:Connect(function()
    print("Spawned")
end)

Both module script and server script are in repStorage (cause bomb is being cloned) Any idea?
Screenshot_90

Your problem could be caused by you firing the Bindable event before the other script had time to connect it to a function. Add a yield before the Bindable event is fired and it should work as expected.

Credits

This was from a old post just edited it abit.

Script does not fire bindable event, but no errors - #19 by metryy

yup! that worked

thanks

it was a simple wait() that helped if anyones wondering

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.