01-15-2012, 10:01 AM | #1 | |
#FF.Pickup Dictator
Beta Tester
Join Date: Aug 2011
Location: Detroit
Gametype: ADL Affiliations: KiNGz . Posts Rated Helpful 100 Times
|
Adding concs to asti
i want to add concs to asti for scouts and medics when they spawn. i have no idea how. heres the lua
Quote:
|
|
|
01-15-2012, 10:49 PM | #2 |
D&A Member
Wiki Team Fortress Forever Staff Join Date: Apr 2007
Posts Rated Helpful 31 Times
|
Add this anywhere, except inside an existing function
Code:
-- Give everyone a full resupply, but strip secondary grenades function player_spawn( player_entity ) local player = CastToPlayer( player_entity ) player:AddHealth( 100 ) player:AddArmor( 300 ) player:AddAmmo( Ammo.kNails, 400 ) player:AddAmmo( Ammo.kShells, 400 ) player:AddAmmo( Ammo.kRockets, 400 ) player:AddAmmo( Ammo.kCells, 400 ) player:AddAmmo( Ammo.kDetpack, 1 ) player:AddAmmo( Ammo.kManCannon, 1 ) if player:GetClass() ~= Player.kScout and player:GetClass() ~= Player.kMedic then player:RemoveAmmo( Ammo.kGren2, 4 ) end if player:GetTeamId() == attackers then UpdateObjectiveIcon( player, ATTACKERS_OBJECTIVE_ENTITY ) elseif player:GetTeamId() == defenders then UpdateObjectiveIcon( player, DEFENDERS_OBJECTIVE_ENTITY ) end end Last edited by Crazycarl; 01-15-2012 at 10:59 PM. |
|
01-17-2012, 12:32 AM | #3 |
#FF.Pickup Dictator
Beta Tester
Join Date: Aug 2011
Location: Detroit
Gametype: ADL Affiliations: KiNGz . Posts Rated Helpful 100 Times
|
that didnt work:/
|
|
01-17-2012, 12:57 AM | #4 |
D&A Member
Wiki Team Fortress Forever Staff Join Date: Apr 2007
Posts Rated Helpful 31 Times
|
Squeeeeek!
|
|
01-17-2012, 03:29 AM | #5 |
Stuff Do-er
Lua Team
Wiki Team Fortress Forever Staff |
Time to get fancy!
Add this to any part of the lua (very bottom would work): Code:
-- save all the functions in a table with the same name as the Lua file -- so we don't accidentally overwrite any saved functions in other files local ff_asti_beta = {} -- save the function in the table ff_asti_beta.player_spawn = player_spawn function player_spawn( player ) -- check to make sure the saved function is actually a function if type(ff_asti_beta.player_spawn) == "function" then -- call the saved function ff_asti_beta.player_spawn( player ) end if IsPlayer( player ) then local player = CastToPlayer( player ) if player:GetClass() == Player.kScout then player:AddAmmo( Ammo.kGren2, 3 ) elseif player:GetClass() == Player.kMedic then player:AddAmmo( Ammo.kGren2, 2 ) end end end
__________________
#FF.Pickup ¤ Fortress-Forever pickups My Non-official Maps Released FF_DM_Squeek - FF_2Mesa3_Classic - FF_Siege_Classic Beta FF_Myth - FF_Redlight_Greenlight Sick of the people on the internet, always moanin'. They just moan. - Karl Pilkington |
|
01-17-2012, 03:30 AM | #6 |
Stuff Do-er
Lua Team
Wiki Team Fortress Forever Staff |
Crazycarl's solution works just as well, by the way. Don't know what you did wrong. Make sure to reload the map after you upload the new lua (ff_restartround works too).
__________________
#FF.Pickup ¤ Fortress-Forever pickups My Non-official Maps Released FF_DM_Squeek - FF_2Mesa3_Classic - FF_Siege_Classic Beta FF_Myth - FF_Redlight_Greenlight Sick of the people on the internet, always moanin'. They just moan. - Karl Pilkington Last edited by squeek.; 01-17-2012 at 03:31 AM. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|