Remote Events not seem to be working

I was truly confused with this issue as I have sempt to debug everything correctly to show what happening, at it doesnt seem to be working.

The way this works is that I have a StarterPlayer localscript going firing out a Remote Event ‘bazinga’. The fire is received into a server script located within a model located in ReplicatedStorage.

I have this under a spawn function() in my StarterPlayer script:

local mouse = Player:GetMouse()
local bulletstuff = FindModel:WaitForChild() -- FindModel finds to model in ReplicatedStorage
local bazinga = bulletstuff:WaitForChild("bazinga") -- bulletstuff is a folder within the model

...

local mousePos = mouse.Hit.Position

bazinga:FireServer(mousePos)

...

ammo = ammo - 1  --# prints anytime I click, used as debug												
print(ammo)

Then this is what I have in my model:

local bulletstuff = script.Parent
local bazinga = bulletstuff:WaitForChild("bazinga")
local FastCast = require(bulletstuff.FastCastRedux)

local function fire(player, mousePos)
	print("shooted doe!") --not printing (fun)
end

bazinga.OnServerEvent:Connect(fire) --connec

Any sort of help would be appreciated, thanks!

Can you add print statements in your LocalScript to further close in where the issue could be?

Forgor to mention, I have a seperate print going on in the same function Ill edit rn thanks lmfao
Anytime I click the function activates and gives me the # of a variable, Id expect the other print to go out with the # as well

Is there anything on your Output at all that seems to be unusual? Such as infinite yield warnings, or red text

can you try adding wait() before firing the event?

edit: or detect if game is loaded before firing the event?

Got it working. Turns out I was trying to do a Server Script in ReplicatedStorage which was an issue that Studio couldnt detect. I alr had a wait down in my function so I put it under there. Thanks!

1 Like