local player = game.Players.LocalPlayer repeat wait() until player.Character local mouse = player:GetMouse() while true do wait() if mouse.Hit then player.Character.Humanoid.WalkToPoint = mouse.Hit.p end end
This makes my character follow my mouse however, I want it to stop after a certain amount of time like 10 seconds. Help me!!11
local player = game.Players.LocalPlayer repeat wait() until player.Character local mouse = player:GetMouse() local seconds = 10 -- Put how long you want it to happen here for i=1,seconds*100 do true do wait(0.01) if mouse.Hit then player.Character.Humanoid.WalkToPoint = mouse.Hit.p end player.Character.Humanoid.WalkToPoint = player.Character.Humanoid.Torso.Position end
local player = game.Players.LocalPlayer repeat wait() until player.Character local mouse = player:GetMouse() local breaker = Instance.new("Part") game:GetService("Debris"):AddItem(breaker,10) while true do wait() if mouse.Hit and breaker ~= nil then player.Character.Humanoid.WalkToPoint = mouse.Hit.p end if breaker == nil then break end end