Apologies for the atrocious code here (i have no idea what im doing), but I’m trying to figure out how to do a sort of Marble Blast Ultra movement system, and I’m trying to figure out how I could use the camera to make the part always move forward when you hold W instead of moving in the same direction.
Here code:
game.StarterPlayer.StarterCharacterScripts.LocalScript
local uis = game:GetService("UserInputService")
local torque = script.Parent.HumanoidRootPart.Torque
local movebro = game.ReplicatedStorage.MoveBro
local maxspeed = 2500
function zoom(key,move)
if uis:IsKeyDown(key) then
if torque.Torque.Magnitude <= maxspeed then
movebro:FireServer(move)
end
end
end
while task.wait(0.15) do
zoom(Enum.KeyCode.W,Vector3.new(-50,0,0))
zoom(Enum.KeyCode.A,Vector3.new(0,0,50))
zoom(Enum.KeyCode.S,Vector3.new(50,0,0))
zoom(Enum.KeyCode.D,Vector3.new(0,0,-50))
end
game.Workspace.Script
local movebro = game.ReplicatedStorage.MoveBro
movebro.OnServerEvent:Connect(function(plr,wheredoimovebro)
plr.Character.HumanoidRootPart.Torque.Torque += wheredoimovebro
end)
StarterCharacter:
marble man.rbxm (5.6 KB)
Any help would be appreciated