Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Ctrl + click unanchor part?

Asked by 6 years ago

Hi guys, I need a ctrl + click unanchor part script, I do not know how to do it.

2 answers

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Hey, what AlexTheCreator said is a way to do it, but not the 'right' way. What you need to do is make a LocalScript, put it in StarterGui or StarterPlayer>StarterPlayerScripts. You need to put this code in the script:

01local Mouse = game:GetService("Players").LocalPlayer:GetMouse()
02local UIS = game:GetService("UserInputService")
03local CTRLisBeingPressed = false
04 
05UIS.InputBegan:connect(function(input)
06    if input.KeyCode == Enum.KeyCode.LeftControl then
07        CTRLisBeingPressed = true
08    end
09end)
10 
11UIS.InputEnded:connect(function(input)
12    if input.KeyCode == Enum.KeyCode.LeftControl then
13        CTRLisBeingPressed = false
14    end
15end)
View all 25 lines...

If you have any other questions, please tell me.

Ad
Log in to vote
1
Answered by 6 years ago
Edited 6 years ago

I'm pretty new but I think you should use the UserInputsService (or https://wiki.roblox.com/index.php?title=API:Class/UserInputService/InputBegan) to detect when the CTRL button is being held and then detect if the block has been clicked using a ClickDetector :)

Answer this question