I cant find it anywhere, so i thought someone would help me :)
My script is
local cframe = model.PrimaryPart.CFrame -- Current CFrame
model:SetPrimaryPartCFrame(cframe * CFrame.Angles(0, math.rad(40), 0)) script.Disabled = true
while wait() do
script.Disabled = true
print(script.Disabled)
Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()
function PressedE(key)
Mouse.KeyDown:connect(PressedE)
while wait() do
script.Disabled = true
print(script.Disabled)
end
end
end

2 comments
Scripts has a property called disabled. You can use User input service to trigger this propperty in a script.
https://developer.roblox.com/en-us/api-reference/function/ContextActionService/BindAction An alternative method is to use ContextActionService. The link above has an example that can easily be adapted for your use-case.