-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathVIP_guild_gold_perk.lua
More file actions
66 lines (60 loc) · 1.78 KB
/
VIP_guild_gold_perk.lua
File metadata and controls
66 lines (60 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
-- Guild Farming perk
-- Originally scripted by FoeReaper
-- Converted to Eluna by Slp13at420
-- This will deposit 10% of a guild members looted gold into there guild bank.
-- this will also use the players VIP level as a multiplier for deposited gold.
--
function GBank_Loot(eventid, player, gold)
local Paccid = player:GetAccountId()
local currency = ""
local convert = 0
local Money = {}
local Vip = ACCT[Paccid].Vip
Money.CopperMath = (math.floor(gold))-(math.floor((gold*0.01)/10^0)*100)
Money.SilverMath = (math.floor(gold*0.01)/10^0)-(math.floor((gold*0.0001)/10^0)*100)
Money.GoldMath = (math.floor(gold*0.0001)/10^0)
if(gold*0.1 > 0) and (gold*0.1 < 100) then
currency = " Copper"
convert = 0.1
elseif(gold*0.1 >= 100) and (gold*0.1 < 10000) then
currency = " Silver"
convert = 0.001
elseif(gold*0.1 >= 10000) then
currency = " Gold"
convert = 0.00001
end
if(Money.CopperMath > 0) and (Money.SilverMath > 0) then
Money.CopperComma = ", "
else
Money.CopperComma = ""
end
if(Money.SilverMath > 0) and (Money.GoldMath > 0) then
Money.SilverComma = ", "
else
Money.SilverComma = ""
end
if(Money.CopperMath > 0) then
Money.Copper = ""..Money.CopperMath.." Copper"
else
Money.CopperComma = ""
Money.Copper = ""
end
if(Money.SilverMath > 0) then
Money.Silver = ""..Money.SilverMath.." Silver"
else
Money.Silver = ""
end
if(Money.GoldMath > 0) then
Money.Gold = ""..Money.GoldMath.." Gold"
else
Money.Gold = ""
end
if(gold > 0) then
if(player:IsInGuild()) then
player:GetGuild():DepositBankMoney(player, (math.floor(gold*0.1)*(Vip)))
player:SendBroadcastMessage("("..(math.floor(((gold)*Vip)*convert)/10^0)..currency.." deposited to guild bank.)")
end
end
end
RegisterPlayerEvent(37, GBank_Loot)
print("Grumbo'z VIP Guild Gold Perk loaded.")