#Unable to fire a server remote event inside a module

1 messages · Page 1 of 1 (latest)

noble bolt
#

I am trying to fire a remote event from a module in replicated storage but somehow the OnServerEvent does not catch the fired event.

Is there any reason to why the FireServer() does not work at all, and how do I fix this?

I am using a FireEvent() method because I couldn't knockback another player using the Bat:Knockback() and my first thought was that maybe because I was trying to manipulate another player on the client which is why linear velocity didn't move the targeted player.

fickle portal
#

if you call the activate function on server it wouldnt work since you cant fireserver on server

noble bolt
#

Don't know much about server client connections but the activate function is being called here, in a client script

fickle portal
#

did it print valid targeT?

noble bolt
#

Yes, it does print "Valid Target!" on the output

fickle portal
#

weird

noble bolt
#

Yeah, very confusing and frustrating.

If you've got any other suggestions I'd be happy to listen and thanks for trying to help me.

fickle portal
#

Weapon:Activate() below it

#

see if it does something

noble bolt
night tokenBOT
#

studio** You are now Level 1! **studio

fickle portal
#

yea

noble bolt
#

Still no luck 😕

Gave the same results as the previous version:
Prints "Valid Target!" but does ignores Blah:FireServer()

fickle portal
#

is it even the same remote?

noble bolt
#

The module and the server script that catches the event both reference the same remote events:

Bat Module:
local Blah = game:GetService("ReplicatedStorage"):WaitForChild("Blah")

Blah Server Script (The server script that catches FireServer() events):
local Blah = game:GetService("ReplicatedStorage"):WaitForChild("Blah")

fickle portal
#

try firing the event from client

noble bolt
fickle portal
#

welp

noble bolt
#

Yeah...

fickle portal
#

make it so the bat module return your target

#

so you can use it

#

there

humble oar
#

Move your blah server script into ServerScriptStorage.

#

Script don't execute in replicatedstorage. You can call stored modules there and execute called code to them but regular scripts are inactive

#

ReplicatedStorage should only be used for storing and calling to assets/modules.

noble bolt
# fickle portal there

Blah server script was already in ServerScriptService

Tried what you suggested and for some unknown reason, it isn't firing the FireServer() event?

fickle portal
#

wdym

#

i thought it did

#

try printing target on server

fickle portal
noble bolt
#

The target exists, it prints the target and yet it still doesn't fire the FireServer() event

onyx sandal
#

does your Weapon:Activate() return someting

noble bolt
# noble bolt

The onserverevent just has this code inside of it:
print("Hello World!") and yet this is the outcome

noble bolt
fickle portal
onyx sandal
#

when you call activate does it return a value

fickle portal
noble bolt
noble bolt
onyx sandal
#

i dont see it return any value

fickle portal
noble bolt
#

Oh that's an old screenshot

fickle portal
#

context matters

onyx sandal
#

can i see it bro

fickle portal
#

see this

onyx sandal
#

thats what ive been asking

noble bolt
#

Here you go

onyx sandal
#

r u passing target to server

#

last SS you're not sending anything

fickle portal
#

omg bro

noble bolt
#

Yes I'm trying to pass the target to the server because I can't manipulate Player2 in the client

night tokenBOT
#

studio** You are now Level 2! **studio

fickle portal
#

read the whole thing

noble bolt
noble bolt
# noble bolt

It doesn't print "Hello World!" when I fire the FireServer() event (This image)

noble bolt
onyx sandal
#

how is it hooked up server wise

fickle portal
onyx sandal
#

am blind

#

whoop

#

hmmmmmm

noble bolt
# onyx sandal how is it hooked up server wise

I have a server script that catches the FireServer() event named "Blah" inside ServerScriptService.

The new update of the module is that Bat:Activated() only returns the target.

The Tool:Activated() is written inside a local script and is the one trying to fire FireServer().