I've been trying to activate a remote function on a key press and it worked in studio, but when I joined the game, it didn't work.
So I tried to narrow down the possibilities of what it could be: I started off by Re-Writing the code (this time using ContextActionService instead of UserInputService), and it still didn't work, so I tried changing the players walk speed (instead of firing a remote function) and again, it worked in studio, but not in the player.
I'm not very adept at scripting (I'm just starting out ;P) so I don't know what the problem with it is. Here is my code:
local showDialog = game.ReplicatedStorage.ShowDialog
-- Will be used for the remote function later
isInRange = true
function sendSignInfo(actionName, userInputState, inputObject)
if isInRange == true and userInputState == Enum.UserInputState.Begin then
print("test")
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 100
end
end
game.ContextActionService:BindAction("keyPress", sendSignInfo, false, Enum.KeyCode.E)
Send help if you know what the problem is!
Thanks, Kyleo.

4 comments
Some of the spacing is messed up from the post, I do (think) I have it formatted correctly. Also there are no errors in the output. ;P
Is this in a LocalScript?
No, regular script in an object, should it be in StarterPlayerScripts?
PlayerGui or Backpack would do fine