-
Notifications
You must be signed in to change notification settings - Fork 7
Get Started
Alf Müller edited this page May 6, 2018
·
2 revisions
Here is the main template for a class:
(tttc_pack1_alf21.lua of ClassPack#1)
AddCSLuaFile()
hook.Add("TTTCPreClassesInit", "InitClassPackOne", function()
AddCustomClass("MANIPULATOR", {
--color = Color(),
name = "manipulator",
weapons = {
"weapon_ttt_satm"
},
items = {
-- here you can insert some items like: EQUIP_ASC
}
})
end)
hook.Add("TTTCFinishedClassesSync", "TTTCClassPackInit", function(ply, first)
if CLIENT and first then -- just on client and first init !
-- setup here is not necessary but if you want to access the role data, you need to start here
-- setup basic translation !
LANG.AddToLanguage("English", CLASSES.MANIPULATOR.name, "Manipulator")
-- just this language too
LANG.AddToLanguage("Deutsch", CLASSES.MANIPULATOR.name, "Manipulierer")
end
end)
For some deeper class creation, look at the Shooter class