✓ Accepted answer
In your case you can use tables and pairs loop like Kanye West said.
local positions = {
["1qq"] = Vector3.new(0, 2, 5),
["2qq"] = Vector3.new(50, 100, 0),
["3qq"] = Vector3.new(0_123, 0.123123, 0),
}
for positionName, vector in pairs(positions) do
if player.Position == vector then
print("Player is in this spot:", positionName)
end
end
This loops through all the positions in the table and checks if player is in the current position. PositionName is the variable name (So "1qq" or "3qq"...) and vector is the position.
This might be inefficient way of doing it as if player position is only 0.1 stud off your spot then it will not work, for that you could use regions.
1 comment
well you can use tables