Essentially, I'm trying to make a script, where the player presses the key 'E', then the brick color changes. However, this does not work. Any explanation or help would be appreciated.
(For more information, this is a normal script within the brick. Do I have to put the script in workspace? or can I keep it within the brick?)
local debounce = false
local userinputservice = game:GetService("UserInputService")
userinputservice.InputBegan:Connect(function(input, gameProcessedEvent)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.E then
if not debounce then
debounce = true
script.Parent.BrickColor = BrickColor.new("Really red")
debounce = false
end
end
end
end)

2 comments
if you really want to change the part’s color to all players then use a remote event.
Thank you!