function Trig_Buy_Strength_Actions takes nothing returns nothing
local integer gold //This is for subtracting and keeping track of the user's gold
local integer str // This is for modifying the attribute.
loop
exitwhen GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD) < 250 //You can change 250 to whatever you want each charge to cost.
set gold = GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD) //Leave this line alone. Sets gold to their gold
call SetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD, (gold - 250)) //Change the 250 to what you changed the other 250 to. This will subtract the gold
set str = (GetHeroStr(udg_Hero[GetPlayerId(GetTriggerPlayer())], false) + 10) // This line needs some editing. Change "udg_Hero" hero to whatever your hero variable in your map is (You need one). Change + 10 to whatever increment you want each purchase to be.
call SetHeroStr(udg_Hero[GetPlayerId(GetTriggerPlayer())], str, true) // Leave this line alone. It sets their attribute to what it should be after purchase.
endloop
endfunction
//===========================================================================
function InitTrig_Buy_Strength takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterPlayerChatEvent( t, Player(0), "-bs", true)
call TriggerAddAction( t, function Trig_Buy_Strength_Actions )
set t = null
endfunction