Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local UserInputService = game:GetService("UserInputService")
- local SwordName
- local SelectionBoxObject
- local HandleObject
- local SelectionBoxKeybind = Enum.KeyCode.E --no need to change this, doesn't work
- local ReachVector = 7 --Minimum reach is 5
- local Player = Players.LocalPlayer
- local Backpack = Player:FindFirstChild("Backpack")
- repeat
- wait()
- until Backpack
- local function SetupReach(Sword)
- local Handle = Sword:FindFirstChild("Handle")
- local SelectionBox = Instance.new("SelectionBox")
- SelectionBox.Parent = Handle
- SelectionBox.Adornee = Handle
- Handle.Massless = true
- Handle.Size = Vector3.new(1, 1, ReachVector)
- SelectionBox = SelectionBox
- end
- local function FindSword()
- for i,v in pairs(Backpack:GetChildren()) do
- local Handle = v:FindFirstChild("Handle")
- if Handle then
- SwordName = v.Name
- SetupReach(v)
- break
- end
- end
- end
- Player.CharacterAdded:Connect(FindSword)
- FindSword()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement