i made the fallowing script, but i get a error involving an expected end, and i was hoping someone could help!
player = game.Players.LocalPlayer
mouse = player:GetMouse()
function FindNearestGrip()
local grips = game.Workspace:FindFirstChild("Grips", true):GetChildren()
table.sort(grips, function(a, b)
local dstA = (a.Position - player.Character.HumanoidRootPart.Position).magnitude
local dstB = (b.Position - player.Character.HumanoidRootPart.Position).magnitude
return a < b
end)
return grips[1]
player.Character.HumanoidRootPart.Position = grips[1]
end
end
mouse.KeyDown:connect(function(key)
if key == 'e' then
FindNearestGrip()
end)
