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

I need help on my script that give you a rope when you click on the part. Can someone help please?

Asked by 5 years ago

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.

0
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. User#21908 42 — 5y
0
Also do not use deprecated code like :connect. Use :Connect. User#21908 42 — 5y
0
Also when creating variables put local in front. That is how you are encouraged to create variables example: local y = "something" User#21908 42 — 5y
0
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. User#21908 42 — 5y
View all comments (2 more)
0
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. User#21908 42 — 5y
0
Also use local functions. lunatic5 409 — 5y

Answer this question