Hello everyone, Its currently very late but I want to finish this before I go to sleep.
So I have a script where a player prints out "In" whenever they press H. However, with the else statement when I press H again it should print "Out". Could someone help me out with this because i'm missing something very simple or im just overthinking something. Thanks.
Local Script:
local REMOTES = game.ReplicatedStorage:WaitForChild("Events")
local uis = game:GetService("UserInputService");
----------------- Remote Function ----------------------
function UIS(key) -- Function for UserInputService
if key.KeyCode == Enum.KeyCode.H then
REMOTES.Printing:FireServer();
end
end
uis.InputBegan:Connect(UIS);
Server Script:
local REMOTES = game.ReplicatedStorage:WaitForChild("Events")
REMOTES.Printing.OnServerEvent:Connect(function(player)
local character = player.Character
if character then
print("In")
else
print("Out")
end
end)

1 comment
Thank you!