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

How to make a part rotation when I press or hold a key ?

I want to make a part rotation and it fly under my hand when I hold a key

2 comments

0

I'm afraid this is not a request site, this is a helping site. If you are looking for help then watch some scripting videos, test out some free models, you can learn from the Wiki too,  and the DevForum.

0

I dont know so I ask ok ?

1 answer

local uis = game:GetService("UserInputService")
local pressed = false

uis.InputBegan:Connect(function(key)
	if key.KeyCode == Enum.KeyCode.E then --Change E to whatever button you want the user to press
		pressed = true
	end
end)

uis.InputEnded:Connect(function(key)
	if key.KeyCode == Enum.KeyCode.E then --Change E to whatever button you want the user to press
		pressed = false
	end
end)

while pressed == true and wait() do
	--what you want the code to do while button is pressed down
end

5 comments

0

why did you tell him!? it's not a request site, you're feeding him at the table like a dog.

0

We are all here to help and learn so I was trying to be helpfull

0

So this is a teaching life web ?

0

Thanks Barty200

0

If this answers your question would you mind setting it as the correct answer

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