I have a LocalScript in StarterGui that detects if the player presses F4. If the player does, it will fire a BindableEvent in ReplicatedStorage, called F4Pressed, which then executes code inside of a server script to mess with some GUIs.
Here's my problem: the server never seems to get any response. There is a print statement in the LocalScript that fires when I press F4, but the server never seems to recognize that the BindableEvent fired.
LocalScript:
player = game.Players.LocalPlayer
mouse = player:GetMouse()
function PressedE(key)
if key:byte() == 29 and game.ReplicatedStorage.Game.Value == false then
print(player.Name.." pressed F4.") -- this print statement goes through just fine
game.ReplicatedStorage.F4Pressed:Fire(player.UserId)
end
end
mouse.KeyDown:connect(PressedE)
Server Script (snippet):
game.ReplicatedStorage.F4Pressed.Event:connect(function(playerId)
print("Hello!") -- never fires
end)

1 comment
Don't use KeyDown! It's deprecated! Use UserInputService or ContextActionService