Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --by SadExility/Unknown, please give credits
- local player = game.Players.LocalPlayer
- local displays = workspace:WaitForChild("WeaponDisplays")
- local function equipKnife(char)
- local torso = char:WaitForChild("LowerTorso")
- local belt = torso:WaitForChild("KnifeBelt")
- local closest = nil
- local dist = math.huge
- for _,v in pairs(displays:GetChildren()) do
- if v:IsA("BasePart") and v.Name == "KnifeDisplay" then
- local d = (v.Position - torso.Position).Magnitude
- if d < dist then
- dist = d
- closest = v
- end
- end
- end
- if closest then
- for _,v in pairs(closest:GetDescendants()) do
- if v:IsA("Attachment") or v:IsA("Motor6D") then
- v:Destroy()
- end
- end
- closest.Anchored = false
- closest.CFrame = belt.WorldCFrame
- local weld = Instance.new("WeldConstraint")
- weld.Part0 = closest
- weld.Part1 = torso
- weld.Parent = closest
- end
- end
- -- primeira vez
- if player.Character then
- equipKnife(player.Character)
- end
- -- quando resetar
- player.CharacterAdded:Connect(equipKnife)
Advertisement
Add Comment
Please, Sign In to add comment