ProximityPrompt pressed a part comes on your torso

Hello,
I have a question. Im making a game, where you have to climb up somewhere at a certain point. For realism I want to make that with a kind of bungee cord.

But how do I make it so that when you press a proximity prompt, a part comes on your torso like a kind of climbing harness?

Ive tried some script from youtube but they doesnt work.
Can somebody please help me?

Thanks

I would recommend creating a RopeConstraint and having it attached to your character when you trigger the ProximityPrompt.

Thanks, do you maybe know a good tutorial for that?

Try using this. Hopefully this solved your problem.

script.Parent.ProximityPrompt.Triggered:Connect(function(plr)
	local char = plr.Character
	
	local Rope = Instance.new("RopeConstraint")
	Rope.Parent = script.Parent	
	Rope.Name = char.Name.."'s Rope"
	
	local Attachment1 = Instance.new("Attachment")
	Attachment1.Name = "Attachment0"
	Attachment1.Parent = script.Parent
	
	local Attachment2 = Instance.new("Attachment")
	Attachment2.Name = "Attachment1"
	Attachment2.Parent = char.Torso

	Rope.Attachment0 = Attachment1
	Rope.Attachment1 = Attachment2

	Rope.Length = 10
	Rope.Visible = true
	Rope.Color = BrickColor.new("Really black")
end)

hey, ive tried to put this script into a proximityprompt but it doesnt work, is there something i did wrong or do i need to add something? I hope you can help me

Replace the top line with:

script.Parent.Triggered:Connect(function(plr)

okay so now i have this:

script.Parent.Triggered:Connect(function(plr)

local char = plr.Character

local Rope = Instance.new("RopeConstraint")
Rope.Parent = script.Parent	
Rope.Name = char.Name.."'s Rope"

local Attachment1 = Instance.new("Attachment")
Attachment1.Name = "Attachment0"
Attachment1.Parent = script.Parent

local Attachment2 = Instance.new("Attachment")
Attachment2.Name = "Attachment1"
Attachment2.Parent = char.Torso

Rope.Attachment0 = Attachment1
Rope.Attachment1 = Attachment2

Rope.Length = 10
Rope.Visible = true
Rope.Color = BrickColor.new("Really black")

end)

Ive also a Part, ProximityPrompt and in there that script but it still doesnt work, does it work for you?

Sorry, I screwed up. Here’s the working one, made sure it worked.
rope.rbxm (4.0 KB)

1 Like

Thank you so much it worked! Im sorry for questioning that much questions xd

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.