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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

[ Content Deleted ]

Previous Thread :: Next Thread 
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
07 Mar 2015 08:40 AM
How can io add q and e too barrel roll???


local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Speed = 0

local Ship = script.Parent.Ship

local KeyUnits = {
r = 0, f = 0,
a = 0, d = 0,
w = 0, s = 0
}

-- Customizable Vars
local MaxSpeed = 50
local SpeedStep = 5 -- by how much does speed change when you press key?
local Rotation = math.pi/32



script.Parent.Ship.BodyForce.force = Vector3.new(0, 196.2, 0) * script.Parent.Ship:GetMass()

Mouse.KeyDown:connect(function(Key)
if KeyUnits[Key] and Key ~= "r" and Key ~= "f" then
KeyUnits[Key] = 1
elseif Key == "r" or Key == "f" then
Speed = math.max(-MaxSpeed, math.min(Speed + (Key == "r" and 1 or -1) * SpeedStep, MaxSpeed))
end
end)

Mouse.KeyUp:connect(function(Key)
if KeyUnits[Key] then
KeyUnits[Key] = 0
end
end)

while wait(0.25) do
script.Parent.Ship.BodyVelocity.velocity = (script.Parent.Ship.CFrame * CFrame.Angles(0, math.pi/2, 0)).lookVector * Speed
script.Parent.Ship.BodyGyro.cframe = script.Parent.Ship.BodyGyro.cframe * CFrame.Angles(0 , (KeyUnits.a - KeyUnits.d) * Rotation, (KeyUnits.w - KeyUnits.s) * Rotation)
end
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
07 Mar 2015 08:50 AM
b
Report Abuse
murcury57 is not online. murcury57
Joined: 30 Jun 2010
Total Posts: 90299
07 Mar 2015 09:06 AM
[ Content Deleted ]
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
07 Mar 2015 09:09 AM
i added that but nothing


local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Speed = 0

local Ship = script.Parent.Ship

local KeyUnits = {
r = 0, f = 0,
a = 0, d = 0,
w = 0, s = 0
}

-- Customizable Vars
local MaxSpeed = 50
local SpeedStep = 5 -- by how much does speed change when you press key?
local Rotation = math.pi/32



script.Parent.Ship.BodyForce.force = Vector3.new(0, 196.2, 0) * script.Parent.Ship:GetMass()

Mouse.KeyDown:connect(function(Key)
if KeyUnits[Key] and Key ~= "r" and Key ~= "f" then
KeyUnits[Key] = 1
elseif Key == "r" or Key == "f" then
Speed = math.max(-MaxSpeed, math.min(Speed + (Key == "r" and 1 or -1) * SpeedStep, MaxSpeed))
end
end)

Mouse.KeyUp:connect(function(Key)
if KeyUnits[Key] then
KeyUnits[Key] = 0
end
end)

while wait(0.25) do
script.Parent.Ship.BodyVelocity.velocity = (script.Parent.Ship.CFrame * CFrame.Angles(0, math.pi/2, 0)).lookVector * Speed
script.Parent.Ship.BodyGyro.cframe = script.Parent.Ship.BodyGyro.cframe * CFrame.Angles(0 , (KeyUnits.a - KeyUnits.d) * Rotation, (KeyUnits.w - KeyUnits.s) * Rotation)
end
local Axis = {
w = 0, a = 0, s = 0, d = 0, q = 0, e = 0
}
local KeyDown

local Part = Instance.new("Part",workspace)
Part.Anchored = true

Mouse.KeyDown:connect(function(Key)
KeyDown = Key:lower()
if(Key == "q")then
Axis.q = 1
elseif(Key == "e")then
Axis.e = 1
end
end)

Mouse.KeyUp:connect(function(Key)
Key = Key:lower()
if(Key == "q")then
Axis.q = 0
elseif(Key == "e")then
Axis.e = 0
end
end)

while wait() do
Part.CFrame = Part.CFrame * CFrame.Angles(math.pi*2*math.rad(Axis.e-Axis.q),0,0)
end
Report Abuse
murcury57 is not online. murcury57
Joined: 30 Jun 2010
Total Posts: 90299
07 Mar 2015 09:10 AM
[ Content Deleted ]
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
07 Mar 2015 09:13 AM
HMm idk why but nothing


local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Speed = 0

local Ship = script.Parent.Ship

local KeyUnits = {
r = 0, f = 0,
a = 0, d = 0,
w = 0, s = 0
}

-- Customizable Vars
local MaxSpeed = 50
local SpeedStep = 5 -- by how much does speed change when you press key?
local Rotation = math.pi/32



script.Parent.Ship.BodyForce.force = Vector3.new(0, 196.2, 0) * script.Parent.Ship:GetMass()

Mouse.KeyDown:connect(function(Key)
if KeyUnits[Key] and Key ~= "r" and Key ~= "f" then
KeyUnits[Key] = 1
elseif Key == "r" or Key == "f" then
Speed = math.max(-MaxSpeed, math.min(Speed + (Key == "r" and 1 or -1) * SpeedStep, MaxSpeed))
end
end)

Mouse.KeyUp:connect(function(Key)
if KeyUnits[Key] then
KeyUnits[Key] = 0
end
end)

while wait(0.25) do
script.Parent.Ship.BodyVelocity.velocity = (script.Parent.Ship.CFrame * CFrame.Angles(0, math.pi/2, 0)).lookVector * Speed
script.Parent.Ship.BodyGyro.cframe = script.Parent.Ship.BodyGyro.cframe * CFrame.Angles(0 , (KeyUnits.a - KeyUnits.d) * Rotation, (KeyUnits.w - KeyUnits.s) * Rotation)
end

local Axis = {
q = 0, e = 0
}



Mouse.KeyDown:connect(function(Key)
Key = Key:lower()
if(Key == "q")then
Axis.q = 1
elseif(Key == "e")then
Axis.e = 1
end
end)

Mouse.KeyUp:connect(function(Key)
Key = Key:lower()
if(Key == "q")then
Axis.q = 0
elseif(Key == "e")then
Axis.e = 0
end
end)

while wait() do
script.Parent.Ship.CFrame = script.Parent.Ship.CFrame * CFrame.Angles(math.pi*2*math.rad(Axis.e-Axis.q),0,0)
end
Report Abuse
murcury57 is not online. murcury57
Joined: 30 Jun 2010
Total Posts: 90299
07 Mar 2015 09:14 AM
[ Content Deleted ]
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
07 Mar 2015 09:21 AM
So why won't it work?
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