local plr = game.Players.LocalPlayer local chr = plr.Character or plr.CharacterAdded:Wait() script.Parent = chr local enableState = { fly = false } local commands = { fly = function(params) enableState.fly = true if enableState.fly then local speed = tonumber(params[1]) or 10 -- Default speed if no parameter while enableState.fly do wait(0.1) if chr.Humanoid.MoveDirection ~= Vector3.new(0, 0, 0) then local vector = chr.Humanoid.MoveDirection * speed chr.HumanoidRootPart.CFrame += vector end end end end, unfly = function() enableState.fly = false end } plr.Chatted:Connect(function(msg) if #msg > 1 and (msg[1] == "/" or msg[1] == ";") then local command = string.split(msg, "/")[1] or string.split(msg, ";")[1] local params = string.sub(msg, 2) -- Get remaining message after command params = string.split(params) for c, f in pairs(commands) do if c == command then f(params) end end end end)