Fly lu

翻译
local p = game.Players.LocalPlayer
local c = p.Character or p.CharacterAdded:Wait()
local hrp = c:WaitForChild("HumanoidRootPart")
local flying = false
local bg, bv, conn
local sg = Instance.new("ScreenGui", p.PlayerGui)
local btn = Instance.new("TextButton", sg)
btn.Size = UDim2.new(0, 160, 0, 55)
btn.Position = UDim2.new(0.75, 0, 0.2, 0)
btn.Text = "طيران العازمي: إيقاف"
btn.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
btn.TextColor3 = Color3.fromRGB(255, 255, 255)
btn.TextScaled = true
btn.MouseButton1Click:Connect(function()
flying = not flying
if flying then
btn.Text = "طيران العازمي: تشغيل"
btn.BackgroundColor3 = Color3.fromRGB(50, 200, 50)
bg = Instance.new("BodyGyro", hrp)
bg.MaxTorque = Vector3.new(4e5, 4e5, 4e5)
bv = Instance.new("BodyVelocity", hrp)
bv.MaxForce = Vector3.new(4e5, 4e5, 4e5)
conn = game:GetService("RunService").RenderStepped:Connect(function()
if flying and bg and bv then
bg.CFrame = workspace.CurrentCamera.CFrame
bv.Velocity = workspace.CurrentCamera.CFrame.LookVector * 60
end
end)
else
btn.Text = "طيران العازمي: إيقاف"
btn.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
if conn then conn:Disconnect() end
if bg then bg:Destroy() end
if bv then bv:Destroy() end
end
end)
添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论