Why is my script skipping "if PlayersInTable[player] do"?
I've asked tons of people to get up to this point (most of the answers didn't work)
This is my script now:
01 | print ( "script started" ) |
04 | local part = script.Parent |
05 | local Amount = script.Parent.Parent.Space 1. SurfaceGui.Amount |
06 | local TPService = game:GetService( "TeleportService" ) |
07 | print ( "locals 1 started" ) |
09 | local PlayerInTable = { } |
11 | local PlayersToTeleport = { PlayerInTable } |
13 | local player = game.Players.LocalPlayer |
20 | print ( "all locals started" ) |
23 | part.Touched:Connect( function (hit) |
24 | if hit.Parent:FindFirstChild( "Humanoid" ) then |
25 | local character = hit.Parent |
26 | local players = game.Players:GetPlayerFromCharacter(character) |
27 | table.insert(PlayerInTable, players) |
28 | print ( "player is in PlayerTable" ) |
31 | if PlayerInTable [ player ] then |
32 | print ( "player table script running" ) |
34 | Amount.Text = counter.. "/6" |
36 | debounce [ player ] = true |
37 | print (player.Name.. " is in table" ) |
40 | print ( "player not in table" ) |
But here is the problem:
01 | if PlayerInTable [ player ] then |
02 | print ( "player table script running" ) |
04 | Amount.Text = counter.. "/6" |
06 | debounce [ player ] = true |
07 | print (player.Name.. " is in table" ) |
10 | print ( "player not in table" ) |
but goes right to the else and prints "player not in table" why?
(most people I ask just ignore me and they dont know either soo..)