Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

When i click a key it should make the part neon, but it isn't working. Help?

i have no idea why it isn't working..

game:GetService('UserInputService').InputBegan(function(InputObject, Processed)

	if InputObject.KeyCode == Enum.KeyCode.A then
		    workspace.Hit1.Material = Enum.Material.Neon
	end
	end)

3 comments

0

Are there any errors in output?

0

no

0

try adding a print statement in the if statement, to see if you are actually pressing anything

2 answers

✓ Accepted answer

Here you go! :)

local Input = game:GetService("UserInputService")

Input.InputBegan:connect(function(InputObject,Processed)
	if not Processed and InputObject.KeyCode == Enum.KeyCode.A then
		game.Workspace.Hit1.Material = Enum.Material.Neon
		
	end
end)

Hey, here’s the right script! Hope it helps :) Accept and upvote if helped, Greatly Appreciated.

local Input = game:GetService("UserInputService")

Input.InputBegan:Connect(function(InputObject,Processed)
    if not Processed and InputObject.KeyCode == Enum.KeyCode.A then
        game.Workspace.Hit1.Material = Enum.Material.Neon
    end
end)

2 comments

0

But I already answered his question.

0

But I already answered his question.

This discussion is preserved as it was. New answers, comments, and votes are closed.