Script about changing brick color isn't working

So I want to change the color of a part when I press the N key. But whenever I press it, it doesn’t work even though I followed the entire tutorial. This is my script

StarterPlayer > StarterCharacterScripts > a Local Script:

local UIS = game:GetService(“UserInputService”)

local KeyDownEvent = game:GetService(“ReplicatedStorage”):WaitForChild(“KeyDown”)

UIS.InputBegan:Connect(function(input)

if input.KeyCode == Enum.KeyCode.N then
	
	KeyDownEvent:FireServer()
	
	
end

end)

ServerScriptService > Script:

local KeyDownEvent = game:GetService(“ReplicatedStorage”)WaitForChild(“KeyDown”)

KeyDownEvent.OnServerEvent:Connect(function()

print "Key Pressed!"

workspace.Part.BrickColor = BrickColor.Random()

end)

and I also placed a remote event on Replicated Storage called “KeyDown”

does it print key pressed? if not then say

add parentheses around the “Key Pressed!”

print("Key Pressed!")

No it does not print “Key Pressed”

I fixed it, but it still doesn’t work

Why do you need to add parentheses?

You don’t have a colon before WaitForChild in your server script

1 Like