What? Why is my function firing when I lift the “R” key and when I press it down and how can I stop this behavior so that it only fires on button down?
function rotate(state)
if state == Enum.UserInputState.Begin and item and item.PrimaryPart then
item:SetPrimaryPartCFrame(item:GetPrimaryPartCFrame() * CFrame.Angles(0, math.rad(rotatenum), 0))
end
end
function rotate(action, state, object)
if state == Enum.UserInputState.Begin and item and item.PrimaryPart then
item:SetPrimaryPartCFrame(item:GetPrimaryPartCFrame() * CFrame.Angles(0, math.rad(rotatenum), 0))
end
end