local Master = require(script.Parent.Parent)
local UIS = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local Character = player.Character or player.CharacterAdded:Wait()
local module = {}
Master.ClientEvents.ShipControls.OnClientEvent:Connect(function()
local IsFlying = Character:GetAttribute("IsFlying")
UIS.InputBegan:Connect(function(Input, IsTyping)
if IsTyping then return end
if Input.KeyCode == Enum.KeyCode.W and IsFlying then
print("SpeedIncreasing")
end
if Input.KeyCode == Enum.KeyCode.S and IsFlying then
print("SpeedDecreasing")
end
end)
end)
return module
hey guys, this is my code so far. Any ideas on how I would script flight and control speeds? Ideally what I am looking to do is that when each button is held, the speed either increases or decreases at a steady rate. I have an idea on how to do that via a loop, but how do I transfer this over to the server in an efficient way? I do not want to use Roblox seats