local UserInputService = game:GetService("UserInputService")
function scanInStorage(placeToScan)
for _, Object in pairs(placeToScan:GetChildren()) do
local Plr = game.Players.LocalPlayer
local Part = Object.Radius
local Distance = 7
local UI = Object["Display Part"].BillboardGui
local Split = string.split(Object.Name, "-")
local Torso = game.Workspace:WaitForChild(Plr.Name, 3).Torso
UI.Frame.Regiment.Text = Split[1]
if (Torso.Position - Part.Position).Magnitude <= Distance then
UserInputService.InputBegan:Connect(
function(Input, GameProcessedEvent)
if Input.UserInputType == Enum.UserInputType.Keyboard then
if Input.KeyCode == Enum.KeyCode.E then
local Remote = game.ReplicatedStorage.Remotes.equipUniform
local Shirt = Object.Shirt.ShirtTemplate
local Pants = Object.Pants.PantsTemplate
wait()
Remote:FireServer(Plr, Shirt, Pants)
end
end
end)
end
end
end
scanInStorage(game.Workspace.UniformHolder)
https://gyazo.com/ab7066fe6edafba25db3877e1a4e0bf7 https://gyazo.com/05e3383815435ff41c06801148e5f15a https://gyazo.com/6ff9819e505e46dfbbabc10f19a3ff4e
error on line 11

2 comments
I used B, thanks for the help! (:
np