Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 7 years ago
Edited 7 years ago

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

Log in to vote
0
Answered by 7 years ago

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

0
Thanks for the notice. BloxaBrick 2 — 7y
0
No problem, have fun scripting! wilsonsilva007 373 — 7y
Ad

Answer this question