So i’ve been wondering how I should make a drone. Not really for building a drone but scripting a drone.
Now I have no idea where to start scripting and how to do it.
So what do I need to make it fly up/down etc? Do I need to use ModuleScript for some things or is that not necessary and how do I use for example the ‘E’ key and what should I use to make it go up/down etc.
Hmmm, never tried this but I think that you can add BodyForces when it is moving for a smooth movement. Aside from that, is pretty much just handling input from player.
local inputService = game:GetService("UserInputService")
inputService.InputBegan:Connect(function(input, gameProcessedEvent)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.E then
--code so the drone will go up
end
end
end)
From there you can add .inputChanged which will let you move it in 2 directions depending, I remember doing something like this a time ago (not for a drone though).
Using RemoteFunction:InvokeClient may be problematic. The DevHub page mentions that it will error if the client disconnects or leaves while it’s being invoked.
And invoking the client tens of times per second will cause unnecessary network traffic. You could just have the client fire a remote event whenever there’s a change in drone movement related input.