Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why doesn't my RemoteEvent fire from this script in the server?


local ReplicatedStorage = game:GetService("ReplicatedStorage")
local GeneralSender = ReplicatedStorage:WaitForChild("GCSInteractor")


game:GetService("UserInputService").InputBegan:connect(function(inputObject, gameProcessedEvent)

if inputObject.KeyCode == Enum.KeyCode.E then
print("KeyPressRecieved")
		GeneralSender:FireServer()


	end
	end)

It's supposed to go to this script.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local GeneralSender = ReplicatedStorage:WaitForChild("GCSInteractor")
local function onGeneralSender() 
print("Launched!")

	end
GeneralSender.OnServerEvent:Connect(onGeneralSender)

It works fine in Solo, but in server it doesn't work at all.

The first script is in a LocalScript in StarterCharacterScripts. The second script is in a model (Not a part) in game.Workspace.

Filtering enabled is on

1 answer

✓ Accepted answer

There's a diference in RemoteEvents and Bindable events. And so to functions. Remote events are in local scripts to comunicate Player to server and server to player. All tho if you want to make a server to server communication you need to use bindable functions. They are pratically the same as remove events so do not worry.

This is the turorial I learned that: https://www.youtube.com/watch?v=jQ0iClyt_zA&t=461s

2 comments

0

Thanks for the notice.

0

No problem, have fun scripting!

This discussion is preserved as it was. New answers, comments, and votes are closed.