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)
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)
"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.