Unable to stop error from happening

I’ve been playing around with this for hours and I’ve looked up each error I’ve recieved and I still wasn’t able to find a workaround for the errors I’ve been getting.

I’m working on a classic sword fighting game and I’ve been trying to get the players to teleport onto the selected map and each time I change something in the teleport script it just gives me these two errors.


( I don’t have a screenshot for the other error but it was attempting to call a table value )

here’s the part of the script that’s messing up:

	for i, player in pairs(plrs) do
	if player then
		character = player.Character		
		if character then				
			character:FindFirstChild("HumanoidRootPart").Position = AvailableSpawn.Poisiton + Vector3.new(0,10,0)
			wait(1)
			table.remove(AvailableSpawn,1)

(note: plrs is a table of all players in game )

please note that the script is from a tutorial and I’ve looked around all over the internet and was still unable to find a solution. all help is appreciated

that is your problem

Position not Poisiton

Hello!
From what I can see, the issue is that you misspelled “Position” simply rewrite it correctly and hopefully that will do the trick!

hi! I rewrote position, but I’m still getting the same error. I’ve tried almost everything I could think of yet nothing seems to be working

What is it? Are you sure it have Position Property

1 Like

Along with what @bjdanh266 stated, I would like to ask if “AvailableSpawn” is equal to a part instance or related to a Vector3?

Could I please confirm what you mean by plrs is a table of all players in the game?

Try this instead of a table of players:
local plrs = game:GetService(“Players”):GetChildren()

Available spawn is a variable for all the spawn locations in the map. ( it’s a just few a transparent parts around each map)

1 Like

From what I’m seeing, AvailableSpawn is in a table? that’s your issue, you’d have to do something weird like :

local a = {workspace.Part1, workspace.Part2} -- The table of stored objects

local random = math.random(1,#a) -- This picks a random object from the table

print(a[random].Position) -- This prints the location of the randomly picked object

Edit, this is probably already known but the table can be like:

local a = Folder:GetChildren()

the players are put into a table to be teleported into the map

	local plrs = {}

for i, player in pairs(game.Players:GetPlayers()) do
	if player then
		table.insert(plrs,player) -- add each player into table
	end
end

AvailableSpawn must be nil, could you please provide the part of the script where you define it?

1 Like

hello everyone! I found the error, I forgot to define a few things beforehand.

the issue is solved now! thanks for all the help.