i cant remove the weld when i trigger the ProximityPrompt
local Anim = script:WaitForChild("Animation") script.Parent.ProximityPrompt.Triggered:Connect(function(player) local hum = player.Character:WaitForChild("Humanoid") local loadAnim = hum.Animator:LoadAnimation(Anim) -- loads animation local length = (player.Character.HumanoidRootPart.Position - script.Parent.Position).Magnitude local char = player.Character or player.CharacterAdded:Wait() local weld = Instance.new("WeldConstraint") if workspace.itilenkontrol.Transparency == 0 then print("a") workspace.itilenkontrol.Transparency = 1 weld.Parent = char weld.Part0 = script.Parent weld.Part1 = char.HumanoidRootPart script.Enabled = false wait(0.01) script.Enabled = true else print("b") workspace.itilenkontrol.Transparency = 0 weld:remove() script.Enabled = false wait(0.01) script.Enabled = true end end)
Try
Weld:Destroy()
Hope this helps!!
I don't think you can enable a script after disabling it, so I don't think the weld is being destroyed