I’m using a hold system, and I’m wondering how to make it so the player can only hold one block at once. How would I achieve this? (A event is fired so I’m not sure if that’d help)
local ClickDetector = script.Parent.ProximityPrompt
local RS = game:GetService("ReplicatedStorage")
local PS = game:GetService("Players")
local HoldEvent = RS:WaitForChild("HoldEvent")
ClickDetector.Triggered:Connect(function(Player)
local LeftArm = Player.Character:WaitForChild("Left Arm")
local Humanoid = Player.Character:WaitForChild("Humanoid")
local Weld = Instance.new("WeldConstraint")
local leftarmpos = nil
script.Parent.CFrame = LeftArm.CFrame + Vector3.new(0, -1.5, 0)
ClickDetector.MaxActivationDistance = 0
Weld.Parent = script.Parent
Weld.Part0 = script.Parent
Weld.Part1 = LeftArm
script.Parent.Anchored = false
script.Parent.CanCollide = false
HoldEvent:FireClient(Player)
HoldEvent.OnServerEvent:Connect(function()
Weld:Destroy()
script.Parent.CanCollide = true
HoldTrack:Stop()
wait(10)
end)
end)
HoldEvent = RS:WaitForChild("HoldEvent")