Hello everyone.
I'm doing more traitor-button for your TTT server, the map I made cs_assault button which when pressed leaves the train, but there are three problems:
1 - The train moves jerkily
2 - Train does not damage
3 - If you stand in front of the train, it will get stuck and the server will down.
The map ttt_67thways_v3 have cars built on the same principle this,but if you stand in front of them they will get stuck, but the server does not fall.
Plz tell me what could be the problem
Code:
[CODE]
aprop={}
table.insert(aprop,{Map="cs_assault",Class="prop_physics",Model="models/hunter/plates/plate2x2.mdl",Pos=Vector(6812,7185,-464),Ang=Angle(90,180,180),Color=Color(255,255,255,0),Motion=false,NoDraw=true})
table.insert(aprop,{Map="cs_assault",Class="path_track",Pos=Vector(7232,8756,-500),Keys={targetname="tend",orientationtype=1}})
table.insert(aprop,{Map="cs_assault",Class="path_track",Pos=Vector(7232,3000,-500),Keys={targetname="tstart",orientationtype=1,target="tend"}})
table.insert(aprop,{Map="cs_assault",Class="func_tracktrain",Pos=Vector(7232,3456,-490),Keys={targetname="train",target="tstart",health=200,height=4,MoveSoundMaxPitch=200,MoveSoundMinPitch=60,wheels=50,volume=10,renderamt=255,rendercolor="255 255 255",startspeed=1600,spawnflags=512}})
table.insert(aprop,{Map="cs_assault",Class="prop_dynamic",Model="models/props_trainstation/train001.mdl",Pos=Vector(7232,3456,-480),Ang=Angle(0,-90,0),Color=Color(255,255,255,0),Keys={targetname="tprop",solid=6,MaxAnimTime=10,MinAnimTime=5},Motion=true,Parent="train"})
table.insert(aprop,{Map="cs_assault",Class="ttt_traitor_button",Pos=Vector(7129,5583,-474),Keys={description="Вызвать поезд",wait=-1,OnPressed="train,StartForward,,1,-1"}})
function propSpawn(class,model,pos,ang,color,motion,draw,key,parent)
local ent = ents.Create(class)
if !IsValid(ent) then return end
if model!= nil then ent:SetModel(model) end
ent:SetPos(pos)
if ang!= nil then ent:SetAngles(ang) end
if key!=nil then
for i,j in pairs (key) do
ent:SetKeyValue(i,j)
end
end
ent:Spawn()
ent:Activate()
local phys = ent:GetPhysicsObject()
if IsValid(phys) then
phys:EnableMotion( motion )
phys:Wake()
end
if color!= nil then ent:SetColor(color) end
if draw!= nil then ent:SetNoDraw(draw) end
if parent!=nil then ent:SetParent(ents.FindByName( parent )[1]) end
end
function InitPostEntity()
for k,v in pairs (aprop) do
if v.Map == game.GetMap() then
propSpawn(v.Class,v.Model,v.Pos,v.Ang,v.Color,v.Motion,v.NoDraw,v.Keys,v.Parent)
end
end
end
hook.Add("InitPostEntity","asdads",InitPostEntity)
[/CODE]
P.S. Sorry for my English
You should just modify the map and make the tracktrain yourself. It doesn't seem ideal to do it with lua, but that's my opinion.
Sorry, you need to Log In to post a reply to this thread.