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
 

Move

Previous Thread :: Next Thread 
bigme2 is not online. bigme2
Joined: 20 Sep 2013
Total Posts: 404
04 Oct 2015 12:20 PM
I'm working on a game called "Hurricane Survival". I made a block representing the hurricane. I want it to do this in a loop:

Step 1: Follow a random Robloxian at a speed slightly lower than the speed of a Robloxian for 10 seconds
Step 2: Do the same thing, just for another Robloxian

I can figure out the ontouched scripts (like when a humanoid touches the hurricane they die), but I need help with making it move.
Report Abuse
bigme2 is not online. bigme2
Joined: 20 Sep 2013
Total Posts: 404
04 Oct 2015 12:22 PM
Anybody??
Report Abuse
hamahama1 is not online. hamahama1
Joined: 25 Oct 2012
Total Posts: 1559
04 Oct 2015 12:29 PM
This is not the forum where people make you free scripts XD
Report Abuse
ShadowOfCrimson is not online. ShadowOfCrimson
Joined: 14 Dec 2009
Total Posts: 2153
04 Oct 2015 01:13 PM
to make it move, I would first grab all the players in the game using plr=game.players:getChildren()

then I would grab a random one with
hurricanetrget=plr(math.random(1,#plr))

as far as moving the hurricane towards that player, it requires a little math.

You basically find the direction from the hurricane to the player and then make the hurricane move that way at a magnitude equal to it's "speed"
Report Abuse
ShungTzu is not online. ShungTzu
Joined: 14 Jun 2014
Total Posts: 959
04 Oct 2015 01:32 PM
function slide(part,goal,speed,portion)
for i=1,speed*((part.Position-goal.p).Magnitude)*portion do
part.CFrame=part.CFrame:lerp(goal,1/speed/((part.Position-goal.p).Magnitude))
wait()
end
part.CFrame=goal
end

part is the part you wnt to move.
goal is the CFrame of the part you want it to move toward.
speed is a number, higher being faster.
portion should be a number, less than one and greater than zero, representing the portion of the distance between the moving part's current position and its goal that you want it to traverse.

chasing=true
while chasing do
slide(Hurricane,player.Character.Head.CFrame,1,.1)
wait(1)
end

It will move the center of the chasing part toward the center of the chased part.
Play with the numbers(speed and portion) to get it to go at the right speed.
Report Abuse
bigme2 is not online. bigme2
Joined: 20 Sep 2013
Total Posts: 404
04 Oct 2015 01:33 PM
I came up with a strategy, so please do not answer anymore.
Report Abuse
ShungTzu is not online. ShungTzu
Joined: 14 Jun 2014
Total Posts: 959
04 Oct 2015 01:39 PM
Oh, sorry, take out

part.CFrame=goal
.

It's for one I use to move it all the way.
Report Abuse
ShungTzu is not online. ShungTzu
Joined: 14 Jun 2014
Total Posts: 959
04 Oct 2015 01:41 PM
It's okay, it's over your head anyway. Nevertheless, you're welcome.
Report Abuse
bigme2 is not online. bigme2
Joined: 20 Sep 2013
Total Posts: 404
04 Oct 2015 01:56 PM
Actually my script didn't work. ShungTzu, I'll try your way, but how do I define player?
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