I've tried it many ways but I couldn't figure out how. I'm trying to do this with UserInputService but i've had no luck. I can make it so that if a key is pressed, something functions but i can't seem to figure out how to detect if a key is not being held anymore
If anybody could help me out that would be great
What i wanted to do is for example this script:
local Player = game.Players.LocalPlayer
local mouse = Player:GetMouse()
local rotate = false
--while wait(0.1) do
--if rotate == true then
--print("Rotating....")
--else
--print("Not Rotating")
--end
--end
mouse.KeyDown:connect(function (key)
for i, v in pairs(game.Players:GetChildren()) do
if key == string.char(19) and v.Name == Player.Name then
rotate = true
end
mouse.KeyUp:connect(function (key)
if key == string.char(19) and v.Name == Player.Name then
rotate = false
end
end)
end
end)
You get the point, the above script is an example and is inefficient + outdated but you should get the point.
Thanks in advance
