Skateboarding System

Hello!

I’m trying to make a skateboarding system from scratch without using vehicles/seats.

In this script it basically just sticks the board to the players hrp position to give the illusion the player is on a skateboard but its SO DELAYED.

How do i fix this :sweat_smile:

edit:

this is a server script (in case you didnt know)

Code:

-- // fixed
2 Likes

sorry didn’t quite see your message in time, what did you say?

1 Like

I said nonsense, sorry (сhar limit)

1 Like

I’m working on your script, I’ll tell you if something works out. (Damn, why was this message edited if I clicked on another button…)

1 Like

ohh what should I use then? Client?

I’m working on your script, I’ll tell you if something works out.

alright, its in server script storage atm, just a skateboard mesh with no collision

alright i got it working, just needed to patch it together on the client! sorry for the waste of time!

2 Likes

In fact, you don’t need to do this on the client. Use your script to see what the movement on the server looks like. You will see that everything is out of sync. Why do you need to set a new board position every frame if Weld does it for you?
Server script:

local RunService = game:GetService("RunService")
local Players = game.Players

game.Players.PlayerAdded:Connect(function(player)
	
	local character = player.Character or player.CharacterAdded:Wait()
	
	local hrp = character:WaitForChild("HumanoidRootPart")
	local boards = game:GetService("ReplicatedStorage").Boards
	local PlayerBoard = --[[here u can create async with datastore]] boards.SimpleBoard:Clone()
	PlayerBoard.Parent = workspace
	PlayerBoard.Position = hrp.Position + Vector3.new(0, -3.15, 0)

	local weld = Instance.new("WeldConstraint")
	weld.Part0 = hrp
	weld.Part1 = PlayerBoard
	weld.Parent = PlayerBoard
	
end)

2 Likes

If you will try to do this on the client (which is the best solution) then you should implement a system for predicting the player’s position in order to properly synchronize the desks with the player on the server.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.