Hi I am trying to make an handcuff system with proximity prompts and in my plan when i trigger the proximity prompt another one should appear underneath it like this:
I don’t know how to make it, here is the code:
local playerService = game:GetService("Players")
local function createPrompt(playerJoined, text, location)
local arrestPrompt = Instance.new("ProximityPrompt")
arrestPrompt.MaxActivationDistance = 5
arrestPrompt.Name = "Manette"
arrestPrompt.Parent = location
arrestPrompt.ObjectText = playerJoined.Name
arrestPrompt.ActionText = text
arrestPrompt.RequiresLineOfSight = false
arrestPrompt.HoldDuration = 1
return arrestPrompt
end
local function createAnimation(character, humanoid)
local arrestedAnimation = Instance.new("Animation", character)
arrestedAnimation.Name = "Arrestato"
arrestedAnimation.AnimationId = "http://www.roblox.com/asset/?id=13274653355"
local arrestedAnimationTrack = humanoid:LoadAnimation(arrestedAnimation)
return arrestedAnimationTrack
end
playerService.PlayerAdded:Connect(function(playerJoined)
playerJoined.CharacterAdded:Connect(function(character)
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
local humanoid = character:WaitForChild("Humanoid")
local prompt = createPrompt(playerJoined, "Arresta", humanoidRootPart)
prompt.Triggered:Connect(function(sender)
local animationTrack = createAnimation(character, humanoid)
animationTrack:Play()
-- Here i would like to create the other prompt
end)
end)
end)