Hi, I am making a mining game and I’m on a deadline, I Have built and scripted an excavator over the past 3 days solid and I implement the driving and its super glitchy, I Have no idea what it could be, The tracks are stationary so it can’t be them, I am using invisible wheels to move the excavator but I don’t know how I can fix them and I’m low key panicking about it and have no idea why.
A Video of the Problem: https://www.youtube.com/watch?v=nnW-NttjIp8
The Game To Experiment: Terrain Destroy - Roblox
I don’t even know where this topic belongs but Its to do with the movement and it only happened since i scripted it so I’m gonna say it goes here for now but any ideas to where I could look in the slightest for hints/tips
btw in the game is the version with and without the tracks, the one from before is without the tracks
controls are W,X,A,D,F,H,J,K,L,M. I think the group is planning a controls gui but I have no idea at the moment. Please send help
Hi, yes sorry, the script is a long one but the scripted part for what I believe is glitchy is the last two functions, the variables are at the top, I know I could do it all through one remote function but I did it this way as it is more laid out.
local EventA = game.ReplicatedStorage.Keys.A
local EventAEnd = game.ReplicatedStorage.Keys.AEnd
local EventD = game.ReplicatedStorage.Keys.D
local EventDEnd = game.ReplicatedStorage.Keys.DEnd
local EventW = game.ReplicatedStorage.Keys.W
local EventWEnd = game.ReplicatedStorage.Keys.WEnd
local EventX = game.ReplicatedStorage.Keys.X
local EventXEnd = game.ReplicatedStorage.Keys.XEnd
local EventK = game.ReplicatedStorage.Keys.K
local EventKEnd = game.ReplicatedStorage.Keys.KEnd
local EventJ = game.ReplicatedStorage.Keys.J
local EventJEnd = game.ReplicatedStorage.Keys.JEnd
local EventL = game.ReplicatedStorage.Keys.L
local EventLEnd = game.ReplicatedStorage.Keys.LEnd
local EventM = game.ReplicatedStorage.Keys.M
local EventMEnd = game.ReplicatedStorage.Keys.MEnd
local EventF = game.ReplicatedStorage.Keys.F
local EventFEnd = game.ReplicatedStorage.Keys.FEnd
local EventH = game.ReplicatedStorage.Keys.H
local EventHEnd = game.ReplicatedStorage.Keys.HEnd
local Player = game.Players.LocalPlayer --Get the player's character here
local value = script.Parent.Sat.Value
local motor = script.Parent.Parent.Chassis.MainChassis.ExcavatorTurntable.Motor
local motorA = script.Parent.Parent.BoomBase.BoomMotor
local motorB = script.Parent.Parent.Boom.JibMount.JibMotor
local motorBA = script.Parent.Parent.Boom.JibMount2.JibMotor2
local motorC = script.Parent.Parent.BucketMount.BucketMotor
local Seat = script.Parent
local RRDrive = script.Parent.Parent.RRDriveRod.RightRearMotor
local RFDrive = script.Parent.Parent.RFDriveRod.RightFrontMotor
local LRDrive = script.Parent.Parent.LRDriveRod.LeftRearMotor
local LFDrive = script.Parent.Parent.LFDriveRod.LeftFrontMotor
local maxspeed = 5
Seat:GetPropertyChangedSignal("Occupant"):Connect(function()
if Seat.Occupant then
value = true
else
value = false
end
end)
--< Turn Left >--
local function ADown()
if value == true then
motor.AngularVelocity = -2
end
end
local function AUp()
motor.AngularVelocity = 0
end
EventA.OnServerEvent:Connect(ADown)
EventAEnd.OnServerEvent:Connect(AUp)
-------------------------------------------------------------------
--< Turn Right >--
local function DDown()
if value == true then
motor.AngularVelocity = 2
end
end
local function DUp()
motor.AngularVelocity = 0
end
EventD.OnServerEvent:Connect(DDown)
EventDEnd.OnServerEvent:Connect(DUp)
-------------------------------------------------------------------
--< Boom Up >--
local function WDown()
if value == true then
motorA.AngularVelocity = 0.5
end
end
local function WUp()
motorA.AngularVelocity = 0
end
EventW.OnServerEvent:Connect(WDown)
EventWEnd.OnServerEvent:Connect(WUp)
-------------------------------------------------------------------
--< Boom Down >--
local function XDown()
if value == true then
motorA.AngularVelocity = -0.5
end
end
local function XUp()
motorA.AngularVelocity = 0
end
EventX.OnServerEvent:Connect(XDown)
EventXEnd.OnServerEvent:Connect(XUp)
-------------------------------------------------------------------
--< Jib Down >--
local function MDown()
if value == true then
motorB.AngularVelocity = -0.5
motorBA.AngularVelocity = 0.5
end
end
local function MUp()
motorB.AngularVelocity = 0
motorBA.AngularVelocity = 0
end
EventM.OnServerEvent:Connect(MDown)
EventMEnd.OnServerEvent:Connect(MUp)
-------------------------------------------------------------------
--< Jib Up >--
local function KDown()
if value == true then
motorB.AngularVelocity = 0.5
motorBA.AngularVelocity = -0.5
end
end
local function KUp()
motorB.AngularVelocity = 0
motorBA.AngularVelocity = 0
end
EventK.OnServerEvent:Connect(KDown)
EventKEnd.OnServerEvent:Connect(KUp)
-------------------------------------------------------------------
--< Close Bucket >--
local function JDown()
if value == true then
motorC.AngularVelocity = -0.5
end
end
local function JUp()
motorC.AngularVelocity = 0
end
EventJ.OnServerEvent:Connect(JDown)
EventJEnd.OnServerEvent:Connect(JUp)
-------------------------------------------------------------------
--< Open Bucket >--
local function LDown()
if value == true then
motorC.AngularVelocity = 0.5
end
end
local function LUp()
motorC.AngularVelocity = 0
end
EventL.OnServerEvent:Connect(LDown)
EventLEnd.OnServerEvent:Connect(LUp)
-------------------------------------------------------------------
--< Right Track Forward >--
local function RTF()
if value == true then
RRDrive.AngularVelocity = 15
RFDrive.AngularVelocity = 15
end
end
local function RTFS()
RRDrive.AngularVelocity = 0
RFDrive.AngularVelocity = 0
end
EventH.OnServerEvent:Connect(RTF)
EventHEnd.OnServerEvent:Connect(RTFS)
-------------------------------------------------------------------
--< Left Track Forward >--
local function LTF()
if value == true then
LRDrive.AngularVelocity = 15
LFDrive.AngularVelocity = 15
end
end
local function LTFS()
LRDrive.AngularVelocity = 0
LFDrive.AngularVelocity = 0
end
EventF.OnServerEvent:Connect(LTF)
EventFEnd.OnServerEvent:Connect(LTFS)
Hmmm, that’s a long script. What I would recommend doing is trying an other way. Maybe use body movers, these can be helpful. Something else you could do is trying searching the Web for other approaches to the topic of making a vehicle.
Hope that helped,
Theyoloman1920
Okay, I will take a look into It and to my knowledge no one has tried this before, and even robotic arms that are about, they don’t have anything helpful in the content provided around the demos as that was what I was doing before this project for a few weeks
Try searching on Youtube “How to make a car in Roblox Studio”, and see different devs’ approach to this. Try manipulating their code to fit your needs.
Awesome, Ill search around and If I can’t find anything ill create a topic going, right I wanna sort my life out cuz this is broken and I got no idea how to fix it, please help