Garry's Mod

Garry's Mod

Evan's Entity Equipped on Spawn Addon
5 条留言
Brgmry 2020 年 12 月 12 日 上午 11:31 
local configTable = {
"TEAM_XYZ"
}
local TeamTbl = {}
hook.Add("Initialize", "convertTeamIds", function()
for index, teamStr in ipairs(configTable) do
local id = _G[teamStr]
if id then
TeamTbl[id] = true
end
end
end)

hook.Add("PlayerSpawn", "Player_Spawn_Give_Thing", function(ply)
if TeamTbl[ply:Team()] then
local ent = ents.Create("starwars_jetpack") --insert any equipable entity here
ent:SetSlotName( ent:GetClass() )
ent:SetPos(ply:GetPos())
ent:SetOwner(ply)
ent:Spawn()
ent:Activate()
ent:Use( ply, ply, USE_ON, -1 )
end
end)
Cyclops 2020 年 12 月 8 日 下午 11:11 
How would I equip the entity to a job rather than a specific player?
Brgmry 2020 年 4 月 15 日 上午 8:14 
ents.Create is returning a nil value for me
Brgmry 2020 年 4 月 15 日 上午 8:13 
Is this meant to work?
Ren 2019 年 4 月 1 日 上午 12:14 
♥♥♥♥♥♥♥♥♥. Where has this been with the Clone Jetpack?