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: Tool[Fly]

Previous Thread :: Next Thread 
arshad145 is not online. arshad145
Joined: 25 Feb 2014
Total Posts: 98
13 Jul 2015 06:30 AM
am new to lua but am not a beginner also...
So anyone give me a hint to make a fly tool?
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
13 Jul 2015 06:53 AM
wait(0.1);
local bg = Instance.new("BodyGyro");
bg.maxTorque = Vector3.new(math.huge,math.huge,math.huge);
local plr = game.Players.LocalPlayer;
local char = plr and plr.Character;
local torso = char and char:FindFirstChild("Torso");
local speed = 100; -- in studs/second, for each second the player flys this many studs
script.Parent.Selected:connect(function(mouse)
bg.Parent = torso;
mouse.Move:connect(function()
local dir = (mouse.Hit.p-torso.Position).unit;
bg.cframe = CFrame.new(mouse.Hit.p,mouse.Hit.p+dir);
torso.Velocity = dir*100;
end);
end);

script.Parent.Deselected:connect(function()
bg.Parent = script;
end);



Place that inside a LocalScript, inside a Hopperbin, and place that in StarterPack.
Report Abuse
arshad145 is not online. arshad145
Joined: 25 Feb 2014
Total Posts: 98
13 Jul 2015 06:55 AM
Thxs but I just wanted a hint and some explanations without bothering someone... :/
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
13 Jul 2015 07:05 AM
It's fine, good practice for me.
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
13 Jul 2015 07:05 AM
@Cease

you forgot to use your speed var and used '100' instead xdd
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
13 Jul 2015 07:11 AM
Thanks, XD.
Report Abuse
arshad145 is not online. arshad145
Joined: 25 Feb 2014
Total Posts: 98
13 Jul 2015 07:13 AM
wait(0.1);
local bg = Instance.new("BodyGyro");
bg.maxTorque = Vector3.new(math.huge,math.huge,math.huge);
local plr = game.Players.LocalPlayer;
local char = plr and plr.Character;
local torso = char and char:FindFirstChild("Torso");
local speed = 100; -- in studs/second, for each second the player flys this many studs
script.Parent.MouseButton1Click:connect(function(mouse)--The Fly was automatically selected then flying without mouse click I changed then its not working...
bg.Parent = torso;
mouse.Move:connect(function()
local dir = (mouse.Hit.p-torso.Position).unit;
bg.cframe = CFrame.new(mouse.Hit.p,mouse.Hit.p+dir);
torso.Velocity = dir*100;
end);
end);

script.Parent.Deselected:connect(function()
bg.Parent = script;
end);
Report Abuse
arshad145 is not online. arshad145
Joined: 25 Feb 2014
Total Posts: 98
13 Jul 2015 07:15 AM
I want to use the mouse click gui then activate fly...
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
13 Jul 2015 07:20 AM
gui.MouseButton1Down:connect(function()

end);
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
13 Jul 2015 07:21 AM
Sorry, didn't see your edits, you may just have to edit it, shouldn't bee too difficult.
Report Abuse
arshad145 is not online. arshad145
Joined: 25 Feb 2014
Total Posts: 98
13 Jul 2015 07:26 AM
no problem
Thanks again am gonna recreate it with my new knowledge obtained from you
"Bodygyro"
Thank once again and yes its easy now...
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
13 Jul 2015 07:56 AM
Not a problem.
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