Creating a Line System

Hi, So I tried to make a Line System where a player moves up every time a player is done with buying items from an NPC Shop, But Here is the issue: I don’t know how to script, whether the part has detected a humanoid or not so here are some explanations. Hopefully, this might give you guys an understanding.
Note: I posted something similar a few days ago but now I need help again so please don’t hate me for this.


There is also a script below to maybe find a way to move the player to the next part.

local Detection2 = game.Workspace.Detection2
local linePart = game.Workspace.LinePart4

local function onTouch(hit)
	if (hit.Parent:FindFirstChild("Humanoid")~= nil) then
		hit.Parent.Humanoid.WalkSpeed = 0
		hit.Parent.Humanoid.JumpPower = 0
		print("Froze Player")
		if not Detection2 then
			hit.Parent.Humanoid:MoveTo(Vector3.new(0.07, 0.275, -43.76))
		end
	end
end

script.Parent.Touched:Connect(onTouch)

I am highly missing something and I need some help, I looked through humanoids and part detections where if a humanoid is found the player will use the :MoveTo but I still don’t really understand the concept.

1 Like

local Detection2 = game.Workspace.Detection2
local linePart = game.Workspace.LinePart4

local function onTouch(hit)
if (hit.Parent:FindFirstChild(“Humanoid”)~= nil) then
hit.Parent.Humanoid.WalkSpeed = 0
hit.Parent.Humanoid.JumpPower = 0
print(“Froze Player”)
if not Detection2 then
hit.Parent.Humanoid:MoveTo(Vector3.new(0.07, 0.275, -43.76))
end
end
end

script.Parent.Touched:Connect(function()
onTouch()
end)

1 Like

I don’t think you have to use Vector3.new.

1 Like

Consider using a table to manage the players who are currently waiting in the line. Whenever a player joins the queue you add them to the end of the table and using the index of their value in the table allows you to pin point their position in the line.

2 Likes

Can you show me how to do that? So do I add like some sort of value then add it to the table? Because you only use detections, I don’t really get it.

Bro’s question was ahead of it’s time with the new line games.