Different spawn point - different maps

Hey, I’m trying to make different spawn point on different maps.
My current code is:

(I had it in a pastbin, so was to lazy to find it again :3)

Anyway, can someone help me and tell me whats wrong? (I get NO errors)

According to your code, your map name should be lowercase. Also you’re not getting errors because it was probably simply spawning your cars at (0,0,0).

I tried this to:
[lua]
CarSpawns = {}
CarSpawns[“RP_EvoCity_v2d.bsp”] = Vector(54.040802, 5700.328125, 128.031250)

function ITEM:USE( ply )
local map = game.GetMap()
local ent = ents.Create(“prop_vehicle_jeep_old”)
ent:SetModel(“models/jeep.mdl”)
ent:SetKeyValue(“vehiclescript”,“scripts/vehicles/jeep_test.txt”)
for k, v in pairs(CarSpawns) do
if k == map then
ent:SetPos(v)
end
end
ent:Spawn()
end
[/lua]

Same result.

game.GetMap returns the name without the “.bsp” on the end. And, it’s best if you do


local map = string.lower(game.GetMap())
if string.lower(k) == map then

Ye, I was just going to test that :slight_smile: And thanks ill try that. :smiley: