generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: walks to random position?

Previous Thread :: Next Thread 
swooby is not online. swooby
Joined: 30 Dec 2010
Total Posts: 1986
20 Nov 2016 07:46 AM
for some reason this script just makes you walk to a random position and not what is told

local plr = game.Players.LocalPlayer
local player = game.Players.LocalPlayer.Character
cp = workspace.WalkToPts.ChoseLeft1


repeat wait()
player.Humanoid.WalkToPoint=Vector3.new(cp.CL1.Position)
until (player.HumanoidRootPart.Position - cp.CL1.Position).magnitude <=2




drink lots of water or ur gonna die
Report Abuse
HumanXerxes is not online. HumanXerxes
Joined: 17 Apr 2011
Total Posts: 1351
20 Nov 2016 08:24 AM
You don't need to make a Vector3 out of a Vector3

Vector3.new(cp.CL1.Position) can just be cp.CL1.Position

Otherwise, it'll walk to 0,0,0 it seems.
Report Abuse
swooby is not online. swooby
Joined: 30 Dec 2010
Total Posts: 1986
20 Nov 2016 08:26 AM
ok thanks, also i need help with pathfinding, also seems to walk to 0,0,0 for some reason


local plr = game.Players.LocalPlayer
local player = game.Players.LocalPlayer.Character

path = game:GetService("PathfindingService"):ComputeRawPathAsync(player.HumanoidRootPart.Position, workspace.WalkToPts.StartPoint.Position,400)
points = path:GetPointCoordinates()
for i,node in ipairs(points) do
player.Humanoid.WalkToPoint=Vector3.new(node[i])
repeat wait() until (node - player.HumanoidRootPart.Position).magnitude <= 4

end




drink lots of water or ur gonna die
Report Abuse
HumanXerxes is not online. HumanXerxes
Joined: 17 Apr 2011
Total Posts: 1351
20 Nov 2016 08:30 AM
Vector3.new(node[i]) -> node
Report Abuse
swooby is not online. swooby
Joined: 30 Dec 2010
Total Posts: 1986
20 Nov 2016 08:55 AM
alright it works, but it only goes to the first point then stops --my script now


local plr = game.Players.LocalPlayer
local player = game.Players.LocalPlayer.Character

path = game:GetService("PathfindingService"):ComputeRawPathAsync(player.HumanoidRootPart.Position, workspace.WalkToPts.StartPoint.Position,400)
points = path:GetPointCoordinates()
print(points[1])
for i,node in ipairs(points) do
player.Humanoid.WalkToPoint=(node)
repeat wait() until (player.HumanoidRootPart.Position-node).magnitude <= 1

end


drink lots of water or ur gonna die
Report Abuse
swooby is not online. swooby
Joined: 30 Dec 2010
Total Posts: 1986
20 Nov 2016 09:22 AM
b


drink lots of water or ur gonna die
Report Abuse
Mr_King8 is not online. Mr_King8
Joined: 31 Jul 2010
Total Posts: 1633
20 Nov 2016 09:33 AM
add

while true do

end


Report Abuse
swooby is not online. swooby
Joined: 30 Dec 2010
Total Posts: 1986
20 Nov 2016 09:34 AM
finally got it, thanks for the help guys!


drink lots of water or ur gonna die
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image