I want to make a script which Enables a Part when R is held down and disables when the R isn't held down. I didn't find any working Script (LocalScript) on the internet. It would be the best if its a (server) Script.
You can create a variable and use UserInputService to detect key holding like i have done below. Insert a local script into StarterGui and place the code i have provided for you below into it.
local UserInputService = game:GetService("UserInputService") local KeyDown = false UserInputService.InputBegan:Connect(function(inputObject) if(inputObject.KeyCode==Enum.KeyCode.R)then KeyDown = true while KeyDown do print("R is being held") wait(0.2) end end end) UserInputService.InputEnded:Connect(function(inputObject) if(inputObject.KeyCode==Enum.KeyCode.R)then KeyDown = false end end)