I am trying to attempt to make a script so when I click on the part it will create a rope for me then I can attach the rope to something. Here is what I have made.
function hi(x)
y = x.Backpack
z = game.Lighting.RopeConstraint
z:Clone().Parent = y
end
script.Parent.ClickDetector.MouseClick:connect(hi)
I am also new to scripting
More in depth of what I am talking about
You know how you can click the "create" tab on Roblox Studio, and then you can select the rope. I want it to be like that but just it be in the game and you click on the part. And also have it let you attach the rope on whatever you click on.

6 comments
Do not use Lighting for storage. I know it is hard to decide with things like ReplicatedStorage ServerStorage to know where to put your stuff. Now that you know though, please keep stuff in a place other than lighting.
Also do not use deprecated code like :connect. Use :Connect.
Also when creating variables put local in front. That is how you are encouraged to create variables example: local y = "something"
Finally, use variable names that make sense and explain by their name what they are holding. Do not use nonsensical names like x, y, z.
Especially when those names are often used for something else. In the case of x, y, z those are used for the 3D space in roblox. People will think you are talking about the y axis or the x axis or something similar.
Also use local functions.