[Close, Please] Need Help With Skateboard Turning Speed

Is there any way to make a skateboard turn fast, like, the classic skateboard? I found one that’s not broken, and it’s from 9 years ago. I just need to know how I can make it turn faster. If code is necessary, just reply.

1 Like

Code would be appreciated at this category.
Thank you. :herb:

IdleDelete

local mountCount = 0 -- used to determine inactivity state of board.
local Board = script.Parent
local Controller


-- uses the mountCount varialbe to determine activity
function waitAndDeleteIfIdle(timeout)
	local oldMountCount = mountCount
	wait(timeout)
	if mountCount == oldMountCount then 
		if not Controller then
			-- DESTROY!
			Board.Parent.Parent = nil
		else
			print("Unexpected: board is idle but is mounted???")
		end
	end
end


function onEquip(humanoid, controller)
	if not Controller then -- debounce
		Controller = controller
		mountCount = mountCount+1
	end
end

function onUnequip(board)
	Controller = nil
	-- this line makes this skateboard clean itself up if unused for one minute
	waitAndDeleteIfIdle(60)
end

-- connect events

Board.equipped:connect(onEquip)
Board.unequipped:connect(onUnequip)

-- main program

-- we could have missed the onEquip event on script start
if Board.Controller and not Controller then
	onEquip(Board.ControllingHumanoid, Board.Controller)
end

Flipper

local parts = script.Parent.Parent:GetChildren()
print("count" .. #parts)
local uprightCF = script.Parent.CFrame

local con = nil

function boardIsFlipped()
	local v1 = script.Parent.CFrame:vectorToWorldSpace(Vector3.FromNormalId(Enum.NormalId.Top))
	local v2 = Vector3.new(0,1,0)

	local ang = math.acos(v1:Dot(v2))

	return ang > 2
end

function onTouched(hit)

	if (hit.Parent ~= nil and hit.Parent:FindFirstChild("Humanoid") ~= nil) then
		if (script.Parent.Controller == nil) then
			if (boardIsFlipped()) then
				con:disconnect()
				con = nil

				print("FLIP IT")
				-- no one is riding this thing

				script.Parent.StickyWheels = false

				-- pin
				local bp = Instance.new("BodyPosition")
				bp.maxForce = Vector3.new(5e7,5e7,5e7)
				bp.position = script.Parent.Position + Vector3.new(0,2,0)
				bp.Parent = script.Parent

				-- flip
				local fg = Instance.new("BodyGyro")
				fg.maxTorque = Vector3.new(5e7,5e7,5e7)
				fg.cframe = uprightCF
				fg.Parent = script.Parent
				wait(1)
				fg:Remove()
				wait(1)
				bp:Remove()

				script.Parent.StickyWheels = true
			end
		end
	end
	wait(1)
	
	if (con == nil) then con = script.Parent.Touched:connect(onTouched) end
end

con = script.Parent.Touched:connect(onTouched)

while true do
	for i=1,#parts do
		if parts[i].className == "Part" and (script.Parent.Position - parts[i].Position).magnitude > 5 then
			script.Parent.Parent:Remove()
		end
	end
	wait(1)
end

Skateboard LocalScript

----------------------------------------------------------------------
--
-- HERE BE DRAGONS!
--
-- You can hack together your own scripts using the objects
-- in here, but this is all highly experimental and *WILL BREAK*
-- in a future release. If that bothers you, look away...
--
-- T
--
-----------------------------------------------------------------------

local Board = script.Parent
local Controller
local Gyro
local CoastingAnim
local KickAnim
local LeftAnim
local RightAnim
local OllieAnim

-- normal maxspeed is 40
local topSpeed = 300

local OllieHack = script.Parent:FindFirstChild("OllieThrust")
if (OllieHack == nil) then
	OllieHack = Instance.new("BodyThrust")
	OllieHack.Name = "OllieThrust"
	OllieHack.force = Vector3.new(0,0,0)
	OllieHack.location = Vector3.new(0,0,-2)
	OllieHack.Parent = Board
end

local lastaction = nil
local lasttime = nil
local jumpok = true

function didAction(action)
	lastaction = action
	lasttime = time()
end



function onAxisChanged(axis)
	Board.Steer = Controller.Steer
	Board.Throttle = Controller.Throttle

	if (Board.Steer == -1) then
		print("Left")
		--CoastingAnim:Stop(1)
		KickAnim:Stop()
		OllieAnim:Stop()
		RightAnim:Stop(.5)
		LeftAnim:Play(.5)
		didAction("left")
	end

	if (Board.Steer == 1) then
		print("Right")
		KickAnim:Stop()
		--CoastingAnim:Stop(1)
		LeftAnim:Stop(.5)
		OllieAnim:Stop()
		RightAnim:Play(.5)
		didAction("right")
	end

	if (Board.Steer == 0) then
		print("Straight")

		KickAnim:Stop()
		LeftAnim:Stop(.5)
		OllieAnim:Stop()
		RightAnim:Stop(.5)
		
		if (lastaction == "go" and time() - lasttime < .1) then
			
		end
		didAction("go")
		--CoastingAnim:Play(1)

		if (Board.CruiseLoop.IsPlaying == false) then Board.CruiseLoop:Play() end
		
	end
end

function enterAirState()
	-- gyrate towards vertical position for better landing
	Gyro.maxTorque = Vector3.new(100, 0, 100)
	jumpok = false
	Board.CruiseLoop:Stop()
	Board.BoardOllie:Play()
end

function exitAirState()
	-- turn off gyro
	Gyro.maxTorque = Vector3.new(0,0,0)
	jumpok = true
	Board.BoardDrop:Play()
	Board.CruiseLoop:Stop()
end

function enterPushingState()
	KickAnim:Play()
end

function enterCoastingState()
	if (Board.CruiseLoop.IsPlaying == false) then Board.CruiseLoop:Play() end
end

function enterStoppingState()
	Board.CruiseLoop:Stop()
	breakModifyAndPlay()
end

function onMoveStateChanged(newState, oldState)
	print(oldState)
	print(newState)
	-- do state exits here
	if oldState == Enum.MoveState.AirFree then exitAirState() end

	-- do state transitions here

	-- do state entries here
	if newState == Enum.MoveState.AirFree then enterAirState() end
	if newState == Enum.MoveState.Pushing then enterPushingState() end
	if newState == Enum.MoveState.Coasting then enterCoastingState() end
	if newState == Enum.MoveState.Stopping then enterStoppingState() end
end


-- initialization/finalization stuff

function makeGyro(humanoid)
	Gyro = Instance.new("BodyGyro")
	Gyro.Name = "SkateboardGyro"
	Gyro.maxTorque = Vector3.new(0,0,0) -- start off
	Gyro.P = 50
	Gyro.D = 50
	Gyro.Parent = humanoid.Parent.HumanoidRootPart
end

function onButtonChanged(button)
	if button == Enum.Button.Dismount then
		Board.ControllingHumanoid.Jump = Controller:getButton(Enum.Button.Dismount)
	end
	if button == Enum.Button.Jump then
		if Controller:getButton(Enum.Button.Jump) and jumpok then
			jumpok = false
			KickAnim:Stop()
			LeftAnim:Stop(.5)

			RightAnim:Stop(.5)
			OllieAnim:Play(0,1,4)
			Board.StickyWheels = false
			Board:ApplySpecificImpulse(Vector3.new(0,45,0))
			OllieHack.force = Vector3.new(0,1200,0)
			didAction("jump")
			delay(.1, function() if (OllieHack ~= nil) then OllieHack.force = Vector3.new(0,0,0) end end)
		else
			Board.StickyWheels = true
		end
	end
end

function onEquip(humanoid, controller)
	print("Board equipped")
	print(controller)
	if not Controller then -- debounce
		Controller = controller
		
		makeGyro(humanoid)
		controller.AxisChanged:connect(onAxisChanged)
		Board.MoveStateChanged:connect(onMoveStateChanged)
		CoastingAnim = humanoid:loadAnimation(Board.coastingpose)	
		LeftAnim = humanoid:loadAnimation(Board.leftturn)
		RightAnim = humanoid:loadAnimation(Board.rightturn)
		OllieAnim = humanoid:loadAnimation(Board.ollie)
		--OllieAnim:AdjustSpeed(2)
		KickAnim = humanoid:loadAnimation(Board.boardkick)
		CoastingAnim:Play()

		Controller:bindButton(Enum.Button.Jump, "Ollie")
		Controller:bindButton(Enum.Button.Dismount, "Dismount")
		Controller.ButtonChanged:connect(onButtonChanged)
	end
end

function onUnequip(board)
	print("Board unequipped")
	Controller = nil
	Gyro.Parent = nil
	Gyro= nil
	CoastingAnim:Stop()
	KickAnim:Stop()
	CoastingAnim = nil
	KickAnim = nil
	LeftAnim:Stop()
	LeftAnim = nil
	RightAnim:Stop()
	RightAnim = nil
	OllieAnim:Stop()
	OllieAnim = nil

	if (OllieThrust ~= nil) then
		OllieThrust:Remove()
		OllieThrust = nil
	end

	Board.CruiseLoop:Stop()
end

-- connect events

Board.equipped:connect(onEquip)
Board.unequipped:connect(onUnequip)

-- main program

-- we could have missed the onEquip event on script start
if Board.Controller and not Controller then

	onEquip(Board.ControllingHumanoid, Board.Controller)

end

function cruiseModify()
	-- change the pitch and volume of the cruising sound

	local v = Board.Velocity.magnitude

	if (v < 1) then
		Board.CruiseLoop.Volume = 0
		return
	end

	local lowPitch = .85
	local topPitch = 1.1

	local lowV = .1
	local topV = 1

	Board.CruiseLoop.Volume = math.min(((topV - lowV) * (v / topSpeed)) + lowV, 1)
	Board.CruiseLoop.Pitch = ((topPitch - lowPitch) * (v / topSpeed)) + lowPitch

	
end

function breakModifyAndPlay()
	local v = Board.Velocity.magnitude
	
	local slowest = 25
	if (v < slowest) then return end

	local lowV = .05
	local topV = .8

	Board.BoardStop.Volume = math.min(((topV - lowV) * (v / (topSpeed - slowest))) + lowV, 1)
	Board.BoardStop:Play()
end

while true do
	cruiseModify()
	wait(.1)
end
1 Like

Sure is taking a while for help to arrive, but hey! Nobody’s obligated to reply, so I can wait.

If you are not receiving help, consider whether you have provided enough details and whether you have made the problem small enough for someone else to look into.

Consider reducing the code given to only the portion that is causing the issues. You should apply basic debugging before asking for help in this category.

1 Like

There’s nothing wrong with what I have. I’m just trying to change a basic mechanic.

So to make the skateboard turn faster you need to decrease the time it takes for the skateboard to rotate when you push a “turn” button. I’m not totally sure what is causing the skateboard to turn from the code samples, perhaps it is governed by the animations that play when turning. If this is the case, you may want to try changing the play speed of the AnimationTrack.

It just turns slowly on its own.

For future reference, you should upload the model file in cases like this. The scripts itself don’t turn it or handle the turning speed, in this case it’s the SkateboardPlatform.

You said it’s from 9 years ago, so it’s using the deprecated SkateboardPlatform based on the properties it uses. SkateboardPlatform is very old, and does not have the ability to change the steer speed. You shouldn’t use a skateboard from 9 years ago for this reason, they aren’t up to date.

You’re probably better off scripting one from scratch or fixing a more recent one, and asking for help if you run into any issues while doing so.