Player immediately going into flight

My friend gave me this adonis flight script and I want to change it around

It immediately sets the player into flight mode and they can fly around until they press F to toggle the flight, but I don’t want it like that. I want the player to be normal until they press F and then they fly and they can keep toggling it on and off, but I don’t know how.

here’s the adonis flight script he gave to me:

local l__UserInputService__1 = game:GetService("UserInputService");
local l__ContextActionService__2 = game:GetService("ContextActionService");
local l__PrimaryPart__3 = script.Parent.PrimaryPart;
if not l__PrimaryPart__3 then
	script:Destroy();
end;
local l__LocalPlayer__4 = game:GetService("Players").LocalPlayer;
local v5 = Instance.new("BodyPosition");
v5.Name = "ADONIS_FLIGHT_POSITION";
v5.Parent = l__PrimaryPart__3;
local v6 = Instance.new("BodyGyro");
v6.Name = "ADONIS_FLIGHT_GYRO";
v6.Parent = l__PrimaryPart__3;
local v7 = Instance.new("NumberValue");
v7.Value = 1;
v7.Parent = l__PrimaryPart__3;
local u1 = {};
local function u2(p1, p2)
	local v8 = CFrame.new(p1.CFrame.p);
	local v9, v10, v11 = (workspace.CurrentCamera.CoordinateFrame - workspace.CurrentCamera.CoordinateFrame.p):toEulerAnglesXYZ();
	return v8 * CFrame.Angles(p2 and v11 or v9, v10, v11);
end;
local u3 = {};
local u4 = {};
local function u5(p3, p4)
	local v12 = p3:Connect(p4);
	table.insert(u1, v12);
	return v12;
end;
local u6 = nil;
local u7 = true;
local function u8()
	if script.Parent.PrimaryPart ~= l__PrimaryPart__3 then
		return;
	end;
	return true;
end;
local u9 = l__LocalPlayer__4.Character:FindFirstChildOfClass("Humanoid");
local u10 = nil;
local l__Animation__11 = script:WaitForChild("Animation");
local l__RunService__12 = game:GetService("RunService");
local u13 = nil;
u13 = function()
	u7 = false;
	u9.PlatformStand = false;
	if u10 ~= nil then
		u10:Stop();
		u10 = nil;
	end;
	if v5 then
		v5.maxForce = Vector3.new(0, 0, 0);
	end;
	if v6 then
		v6.maxTorque = Vector3.new(0, 0, 0);
	end;
end;
local u14 = false;
local function u15()
	local v13 = 0;
	local l__Value__14 = v7.Value;
	local l__CurrentCamera__15 = workspace.CurrentCamera;
	local v16 = {};
	local l__CFrame__17 = l__PrimaryPart__3.CFrame;
	local u16 = l__Value__14;
	local u17 = l__Value__14 / 25;
	u5(v7.Changed, function()
		u16 = v7.Value;
		u17 = u16 / 25;
	end);
	v5.Position = l__PrimaryPart__3.Position;
	v5.MaxForce = Vector3.new(math.huge, math.huge, math.huge);
	v6.CFrame = l__PrimaryPart__3.CFrame;
	v6.MaxTorque = Vector3.new(9000000000, 9000000000, 9000000000);
	u6 = v16;
	while u7 and u6 == v16 and u8() do
		local v18 = u9:FindFirstChildOfClass("Animator");
		if v18 and u10 == nil then
			u10 = v18:LoadAnimation(l__Animation__11);
			u10:Play();
		end;
		local v19 = v6.cframe - v6.cframe.p + v5.position;
		if not u3.Forward and not u3.Backward and not u3.Up and not u3.Down and not u3.Left and not u3.Right then
			v13 = 1;
		else
			if u3.Up then
				v19 = v19 * CFrame.new(0, v13, 0);
				v13 = v13 + u17;
			end;
			if u3.Down then
				v19 = v19 * CFrame.new(0, -v13, 0);
				v13 = v13 + u17;
			end;
			if u3.Forward then
				v19 = v19 + l__CurrentCamera__15.CoordinateFrame.LookVector * v13;
				v13 = v13 + u17;
			end;
			if u3.Backward then
				v19 = v19 - l__CurrentCamera__15.CoordinateFrame.LookVector * v13;
				v13 = v13 + u17;
			end;
			if u3.Left then
				v19 = v19 * CFrame.new(-v13, 0, 0);
				v13 = v13 + u17;
			end;
			if u3.Right then
				v19 = v19 * CFrame.new(v13, 0, 0);
				v13 = v13 + u17;
			end;
			if u16 < v13 then
				v13 = u16;
			end;
		end;
		u9.PlatformStand = true;
		v5.position = v19.p;
		if u3.Forward then
			v6.cframe = l__CurrentCamera__15.CoordinateFrame * CFrame.Angles(-math.rad(v13 * 7.5), 0, 0);
		elseif u3.Backward then
			v6.cframe = l__CurrentCamera__15.CoordinateFrame * CFrame.Angles(math.rad(v13 * 7.5), 0, 0);
		else
			v6.cframe = l__CurrentCamera__15.CoordinateFrame;
		end;
		l__RunService__12.RenderStepped:Wait();	
	end;
	u13();
end;
local function u18()
	if not u14 then
		u14 = true;
		if not u7 then
			u7 = true;
			coroutine.wrap(u15)();
		else
			u7 = false;
			u13();
		end;
		wait(0.5);
		u14 = false;
	end;
end;
u5(l__PrimaryPart__3.DescendantRemoving, function(p5)
	if p5 == v5 or p5 == v6 or p5 == v7 then
		for v20, v21 in pairs(u1) do
			v21:Disconnect();
		end;
		u13();
	end;
end);
local function u19(p6, p7, p8)
	if not p7 and p6.UserInputType == Enum.UserInputType.Keyboard then
		if p6.KeyCode == Enum.KeyCode.W then
			u4.Forward = p8;
			u3.Forward = p8;
			return;
		end;
		if p6.KeyCode == Enum.KeyCode.A then
			u4.Left = p8;
			u3.Left = p8;
			return;
		end;
		if p6.KeyCode == Enum.KeyCode.S then
			u4.Backward = p8;
			u3.Backward = p8;
			return;
		end;
		if p6.KeyCode == Enum.KeyCode.D then
			u4.Right = p8;
			u3.Right = p8;
			return;
		end;
		if p6.KeyCode == Enum.KeyCode.Q then
			u4.Down = p8;
			u3.Down = p8;
			return;
		end;
		if p6.KeyCode == Enum.KeyCode.Space then
			u4.Up = p8;
			u3.Up = p8;
			return;
		end;
		if p6.KeyCode == Enum.KeyCode.F and p8 == true then
			u18();
		end;
	end;
end;
u5(l__UserInputService__1.InputBegan, function(p9, p10)
	u19(p9, p10, true);
end);
u5(l__UserInputService__1.InputEnded, function(p11, p12)
	u19(p11, p12, false);
end);
coroutine.wrap(u15)();
if not l__UserInputService__1.KeyboardEnabled then
	local function u20(p13, p14)
		for v22, v23 in next, {
			Forward = (u2(p13, true) * CFrame.new(0, 0, -1) - p13.CFrame.p).p, 
			Backward = (u2(p13, true) * CFrame.new(0, 0, 1) - p13.CFrame.p).p, 
			Right = (u2(p13) * CFrame.new(1, 0, 0) - p13.CFrame.p).p, 
			Left = (u2(p13) * CFrame.new(-1, 0, 0) - p13.CFrame.p).p
			} do
			if (v23 - p14).Magnitude <= 1.05 and p14 ~= Vector3.new(0, 0, 0) then
				u3[v22] = true;
			elseif not u4[v22] then
				u3[v22] = false;
			end;
		end;
	end;
	u5(u9.Changed, function()
		u20(l__PrimaryPart__3, u9.MoveDirection);
	end);
	l__ContextActionService__2:BindAction("Toggle Flight", u18, true);
	l__ContextActionService__2:SetPosition("Toggle Flight", UDim2.new(0.5, 0, -0.2, 0));
	l__ContextActionService__2:SetImage("Toggle Flight", "rbxassetid://9663439657");
	l__LocalPlayer__4.PlayerGui.ContextActionGui.ContextButtonFrame.ContextActionButton.ActionIcon.AnchorPoint = Vector2.new(0.5, 0.5);
	l__LocalPlayer__4.PlayerGui.ContextActionGui.ContextButtonFrame.ContextActionButton.ActionIcon.Position = UDim2.new(0.55, 0, 0.45, 0);
	l__LocalPlayer__4.PlayerGui.ContextActionGui.ContextButtonFrame.ContextActionButton.ActionIcon.Size = UDim2.new(3.75, 0, 3.75, 0);
	while u8() do
		l__RunService__12.Stepped:Wait();	
	end;
	l__ContextActionService__2:UnbindAction("Toggle Flight");
end;

Then use the actual adonis flight script, do not repost one that was stolen. Who knows it has some changes?
Edit: It does have some changes!

local l__Animation__11 = script:WaitForChild("Animation");
--
while u7 and u6 == v16 and u8() do
		local v18 = u9:FindFirstChildOfClass("Animator");
		if v18 and u10 == nil then
			u10 = v18:LoadAnimation(l__Animation__11);
			u10:Play();
		end;

This is not in the original script!

This is the exact same as the adonis flight script, except the “:fly” part is taken out and an animation is added

when the player says :fly, this is added to them and they immediately fly. (in adonis)
im trying to change it and i dont know how, so i’m asking here. now if you won’t help stop commenting

Then why does it have an animation with a synapse x variable?

it’s literally an animation… bloody hell an animation in a flight script what a crime!

Like I said, stop commenting. You are not helping in any way and are just trying to start unnecessary arguments.

1 Like

Why are we letting a thread that has a stolen script in it get away with it?
This is the same as somebody posting an entire game stolen client frame work script and asking help for it.

I’m not letting anything get away, I have messaged the OP and about to discuss the script with them.

Like you could do something by commenting on it :skull: just report it if you think its stolen

I did, i flagged it with the reason being stolen script and reposted deleted post:

Then you shouldnt continue arguing and let roblox staff do the job

3 Likes

as i said, there has been the “:fly” command part removed and other things linked to the “fly” command, and an animation has been added

This is literally the entire fly function plus
The animation is variable just like other services that are namde by luau decompiler
l__Service__NumberByOrder

Function = function(plr: Player, args: {string})
				local speed = tonumber(args[2]) or 2
				local scr = Deps.Assets.Fly:Clone()
				local sVal = service.New("NumberValue", {
					Name = "Speed";
					Value = speed;
					Parent = scr;
				})
				local NoclipVal = service.New("BoolValue", {
					Name = "Noclip";
					Value = args[3] and (string.lower(args[3]) == "true" or string.lower(args[3]) == "yes");
					Parent = scr;
				})
				
				scr.Name = "ADONIS_FLIGHT"
				
				for i, v in service.GetPlayers(plr, args[1]) do
					local part = v.Character:FindFirstChild("HumanoidRootPart")
					if part then
						local oldp = part:FindFirstChild("ADONIS_FLIGHT_POSITION")
						local oldpa = part:FindFirstChild("ADONIS_FLIGHT_POSITION_ATTACHMENT")
						local oldg = part:FindFirstChild("ADONIS_FLIGHT_GYRO")
						local oldga = part:FindFirstChild("ADONIS_FLIGHT_GYRO_ATTACHMENT")
						local olds = part:FindFirstChild("ADONIS_FLIGHT")
						if oldp then oldp:Destroy() end
						if oldpa then oldpa:Destroy() end
						if oldg then oldg:Destroy() end
						if oldga then oldga:Destroy() end
						if olds then olds:Destroy() end
						
						local new = scr:Clone()
						local flightPositionAttachment: Attachment = service.New("Attachment")
						local flightGyroAttachment: Attachment = service.New("Attachment")
						local flightPosition: AlignPosition = service.New("AlignPosition")
						local flightGyro: AlignOrientation = service.New("AlignOrientation")
						
						flightPositionAttachment.Name = "ADONIS_FLIGHT_POSITION_ATTACHMENT"
						flightPositionAttachment.Parent = part
						
						flightGyroAttachment.Name = "ADONIS_FLIGHT_GYRO_ATTACHMENT"
						flightGyroAttachment.Parent = part
						
						flightPosition.Name = "ADONIS_FLIGHT_POSITION"
						flightPosition.MaxForce = 0
						flightPosition.Position = part.Position
						flightPosition.Attachment0 = flightPositionAttachment
						flightPosition.Mode = Enum.PositionAlignmentMode.OneAttachment
						flightPosition.Parent = part
						
						flightGyro.Name = "ADONIS_FLIGHT_GYRO"
						flightGyro.MaxTorque = 0
						flightGyro.CFrame = part.CFrame
						flightGyro.Attachment0 = flightGyroAttachment
						flightGyro.Mode = Enum.OrientationAlignmentMode.OneAttachment
						flightGyro.Parent = part
						
						new.Parent = part
						new.Disabled = false
						Remote.MakeGui(v, "Notification", {
							Title = "Flight";
							Message = "You are now flying. Press E to toggle flight.";
							Time = 10;
						})
					end
				end
			end
		};```