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 » Scripting Helpers
Home Search
 

Re: :MoveTo Problem

Previous Thread :: Next Thread 
rocketlad is not online. rocketlad
Joined: 01 Jan 2008
Total Posts: 1132
28 Dec 2011 11:26 AM
function onTouched(hit)
if hit.Name == "Paintball" then
script.Parent.Parent.Humanoid:MoveTo(Vector3.new(math.random(-453.5,690.5),math.random(2.8, 2.9),math.random(-1016,456)))
end
end

script.Parent.Touched:connect(onTouched)

In the output it says:
Argument 2 missing or nil

I'm trying to make it so when a Paintball hits the model, the model moves to a random spot between those coordinates, but it doesn't do anything. Please help me out here. :)
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
28 Dec 2011 11:28 AM
There's no int value between 2.8 and 2.9
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
28 Dec 2011 11:28 AM
So in in practice it's a nil value
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
28 Dec 2011 11:29 AM
script.Parent.Parent:MoveTo(Vector3.new(math.random(-453.5,690.5),math.random(2.8, 2.9),math.random(-1016,456)))

try that

~I've been to nil and back.
Report Abuse
rocketlad is not online. rocketlad
Joined: 01 Jan 2008
Total Posts: 1132
28 Dec 2011 11:38 AM
Su8, what would I do then?
I changed it to this:
script.Parent.Parent.Humanoid:MoveTo(Vector3.new(math.random(-453.5,690.5),2.8,math.random(-1016,456)))
But it didn't work.

Also, how come this works if this respawn script that I made works?
name="Humanoid"

deer = script.Parent:clone()

while true do
wait(5)
if script.Parent.Humanoid.Health<1 then
deer1 = deer:clone()
deer1.Parent = script.Parent.Parent
deer1:makeJoints()
script.Parent:remove()
deer1:MoveTo(Vector3.new(math.random(-453.5,690.5),math.random(2.8, 2.9),math.random(-1016,456)))
end
end

And MrgamesNwatch, wouldn't that just teleport it without it walking there like in my respawn script above?
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
28 Dec 2011 11:54 AM
ooohhhh... well in that case :MoveTo() doesn't work on player controlled Humanoids. :\

~I've been to nil and back.
Report Abuse
rocketlad is not online. rocketlad
Joined: 01 Jan 2008
Total Posts: 1132
28 Dec 2011 12:03 PM
It isn't player controlled. It is supposed to move the deer to a random position if it is touched by a bullet.
Report Abuse
Wil2 is not online. Wil2
Joined: 01 Feb 2008
Total Posts: 728
28 Dec 2011 12:11 PM
your all wrong
Report Abuse
Wil2 is not online. Wil2
Joined: 01 Feb 2008
Total Posts: 728
28 Dec 2011 12:12 PM
MoveTo() has 2 arguments if you use it on Humanoids. 1 is the position, 2nd is the part your mainly walk on.
Ex: hum:MoveTo(Vector3.new(0,0,0),workspace.Ground)
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
28 Dec 2011 12:32 PM
^ oyus i totally forgot about the second argument :O

~I've been to nil and back.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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