![]() If Key.Ke圜ode = Enum.Ke圜ode.A and Shift = true thenĮlseif Key.Ke圜ode = Enum.Ke圜ode.D and Shift = true then If Key.Ke圜ode = Enum.Ke圜ode.W and Shift = true thenĮlseif Key.Ke圜ode = Enum.Ke圜ode.S and Shift = true then If Key.Ke圜ode = Enum.Ke圜ode.LeftShift then Game:GetService("UserInputService").InputBegan:Connect(function(Key) If 1 = selectedPart and MouseDown = false then Uis.InputEnded:Connect(function(input, proc) If Mouse.Target ~= nil and Player:FindFirstChild("Tool") = nil and MouseDown = true then Uis.InputBegan:Connect(function(input, proc) ![]() Local uis = game:GetService("UserInputService") Here is my current code local Mouse = :GetMouse() I have tried that but cannot find a solution to it using tick(). If Mouse.Target:FindFirstChild("CanDrag") ~= nil then ![]() If Mouse.Target ~= nil and Player:FindFirstChild("Tool") = nil then Uis.InputBegan:Connect(function(inputObject, proc) If inputObject.UserInputType = 1 and not proc then Here is my current code uis.InputEnded:Connect(function(inputObject, proc) (don’t forget the Citizen.Wait(0) in the “while iscontrolpressed” because if you don’t add that, 60 ticks will be reached within 1 frame as it doesn’t pause and wait for the next frame).This solution kind of works, but I can no longer drop the part after it is picked up, it just stays there forever. That’s how I used to check if a button was held down for 1 second before opening a menu for example. Reset the pressed variable (remove this if you call a function instead) let go of the button before re-running the task again. Remove this while not loop if you don't want to wait for the user to again and again if the player keeps holding down the button) ![]() ![]() Now wait until the button is released (to avoid running the timer above Pressed = true - or just call a function to be executed here If the timer is 60 or more, stop the loop (60 ticks/frames = +/- 1second) Loop as long as the control is held down. to determine if the button has been held down for +/- 1 second. Check for this variable in other parts of your code ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |