What I’m trying to make is a Message that the Server will send once a KeyBind is clicked on the players keyboard.
But there’s an issue, when I add ‘if input == Enum.KeyCode.E’ it won’t print or do anything, instead it just sits there with no errors in the output. But when I remove the If statement in the script, when you do anything it works (as it should).
Added If Statement (Clicked btw):
No If Statement (Clicked btw):
I looked on the DevForum and couldn’t find anything, absolutely nothing. I tried to add it into a regular script, not a local and as it should, it wouldn’t work because you can’t set CoreGui in a Regular script.
Here’s my script:
local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local starterGui = game.StarterGui
UIS.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input == Enum.KeyCode.P then
starterGui:SetCore("ChatMakeSystemMessage", {
Text = "Test";
Color = Color3.fromRGB(255, 255, 255);
Font = Enum.Font.SourceSansBold;
FontSize = Enum.FontSize.Size32;
})
print("A")
else
end
end)
Please help me, I am really desperate for this to work LOL.