I using a upgrades system for TTT and works perfectly... almost. I trying to figure out how to make the radar auto-recharge when someone have a radar booster...But I really don't know what I need to do, I feel kinda dumb xD
Can someone send me a help?
Code:
if CLIENT then
EVENT.Hooks = { "TTTBoughtItem" }
else
EVENT.Hooks = { "Think" }
end
if SERVER then
function EVENT:Think()
if GetRoundState() == ROUND_ACTIVE then
for k,v in pairs(player.GetHumans()) do
if not v:IsActiveTraitor() and not v:HasEquipmentItem(EQUIP_RADAR) then continue end
if v.radar_charge > CurTime() and not v.done_radar_charge then
v.radar_charge = v.radar_charge - 25
v.done_radar_charge = true
end
if v.radar_charge < CurTime() and v.done_radar_charge then
v.done_radar_charge = false
end
end
end
end
else
function EVENT:TTTBoughtItem(is_item, id)
if is_item and id == EQUIP_RADAR then
if UpgradeEnabled and UpgradeEnabled("radar_boost_three") then
RADAR.duration = 6
else
RADAR.duration = 30
end
end
end
end
Sorry, you need to Log In to post a reply to this thread.