Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Making a flying script I need help?

Asked by 10 years ago

Ok I need too know did Roblox make changes I need too know about because this is a normal flying script but It works in build and Edit Anything I'm doing wrong?

speed = 100 script.Parent.Selected:connect(function(m) torso = script.Parent.Parent.Parent.Character.Torso bv = Instance.new("BodyVelocity") bv.maxForce = Vector3.new(0,math.huge,0) bv.velocity = Vector3.new(0,0,0) bv.Parent = torso bg = Instance.new("BodyGyro") bg.maxTorque = Vector3.new(0,0,0) bg.Parent = torso connection = m.Button1Down:connect(function() bv.maxForce = Vector3.new(math.huge,math.huge,math.huge) bg.maxTorque = Vector3.new(10000,10000,0) bg.cframe = CFrame.new(torso.Position,m.hit.p) * CFrame.fromEulerAnglesXYZ(math.rad(-90),0,0) bv.velocity = CFrame.new(torso.Position,m.hit.p).lookVector * speed moveconnect = m.Move:connect(function() bg.maxTorque = Vector3.new(30000,30000,0) bg.cframe = CFrame.new(torso.Position,m.hit.p) * CFrame.fromEulerAnglesXYZ(math.rad(-90),0,0) bv.velocity = CFrame.new(torso.Position,m.hit.p).lookVector * speed end) upconnect = m.Button1Up:connect(function() moveconnect:disconnect() upconnect:disconnect() bv.velocity = Vector3.new(0,0,0) bv.maxForce = Vector3.new(0,math.huge,0) torso.Velocity = Vector3.new(0,0,0) bg.cframe = CFrame.new(torso.Position,torso.Position + Vector3.new(torso.CFrame.lookVector.x,0,torso.CFrame.lookVector.z)) wait(1) pcall(function() bg.maxTorque = Vector3.new(0,0,0) end) end) end) end) script.Parent.Deselected:connect(function() bv:remove() bg:remove() if connection ~= nil then connection:disconnect() end if moveconnect ~= nil then moveconnect:disconnect() end if upconnect ~= nil then upconnect:disconnect() end end)

0
Please put it in Lua code format for God sake TurboFusion 1821 — 10y
0
Can't it's not my it's my friends And thank you for your feedback. :) StumpySays 0 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago

I just copied and pasted the script. I made no changes. I also need this question answered because my script does the same as this one. Works in testing, but not in game.

speed = 100 script.Parent.Selected:connect(function(m) torso = script.Parent.Parent.Parent.Character.Torso bv = Instance.new("BodyVelocity") bv.maxForce = Vector3.new(0,math.huge,0) bv.velocity = Vector3.new(0,0,0) bv.Parent = torso bg = Instance.new("BodyGyro") bg.maxTorque = Vector3.new(0,0,0) bg.Parent = torso connection = m.Button1Down:connect(function() bv.maxForce = Vector3.new(math.huge,math.huge,math.huge) bg.maxTorque = Vector3.new(10000,10000,0) bg.cframe = CFrame.new(torso.Position,m.hit.p) * CFrame.fromEulerAnglesXYZ(math.rad(-90),0,0) bv.velocity = CFrame.new(torso.Position,m.hit.p).lookVector * speed moveconnect = m.Move:connect(function() bg.maxTorque = Vector3.new(30000,30000,0) bg.cframe = CFrame.new(torso.Position,m.hit.p) * CFrame.fromEulerAnglesXYZ(math.rad(-90),0,0) bv.velocity = CFrame.new(torso.Position,m.hit.p).lookVector * speed end) upconnect = m.Button1Up:connect(function() moveconnect:disconnect() upconnect:disconnect() bv.velocity = Vector3.new(0,0,0) bv.maxForce = Vector3.new(0,math.huge,0) torso.Velocity = Vector3.new(0,0,0) bg.cframe = CFrame.new(torso.Position,torso.Position + Vector3.new(torso.CFrame.lookVector.x,0,torso.CFrame.lookVector.z)) wait(1) pcall(function() bg.maxTorque = Vector3.new(0,0,0) end) end) end) end) script.Parent.Deselected:connect(function() bv:remove() bg:remove() if connection ~= nil then connection:disconnect() end if moveconnect ~= nil then moveconnect:disconnect() end if upconnect ~= nil then upconnect:disconnect() end end)
Ad
Log in to vote
-1
Answered by 10 years ago

"Please put it in Lua code format for God sake"

The code still works either way. I'm the one who wrote this code. Me and him are making a game together and the script works completely fine in Build and Edit mode, but when we play the actual game it does not.

0
We still want to be able to see it easilly, and that would be in code block. ultrabug 306 — 10y
0
Well my friend posted this so talk to him. alienantics 15 — 10y

Answer this question