I want the mouse part to crawl up the player, and weld to the player and then the players movement is altered and he cannot walk straight kind of like ziggy zaggy and then after some time but not at the same time the mouse falls off the player.
Idk how I would make such a script escpecially the crawling up part can anyone help me
function GetClosestPlayerFromObject(object)
local InRange = {}
local MaxRange = 20
for _, player in pairs(game.Players:GetPlayers()) do
if (object.Position - player.Position).Magnitude <= MaxRange then
table.insert(InRange, {Player = player, Range = (object.Position - player.Position).Magnitude}) -- Adds player
end
end
table.sort(InRange, function(A,B) return A.Range < B.Range end) -- Change < to > if it's not ascending
return InRange[1].Player -- Returns the closest player
end
while wait(1) do
local ClosePlayer = GetClosestPlayerFromObject(script.Parent)
if ClosePlayer.Humanoid then
end
end