This script is a cage fight challenge, you vs 6 people. It costs $2500 to play and if you finish them all then you’ll win $10k.
Each opponent is stronger and has more health. The player has a stamina bar that goes down when punching, kicking, or dodging. If the bar is empty then you can’t do any of these actions and you need to wait for it to regenerate.
This resource can be used with any framework. And the price to play and the winning money is configurable.
Disclaimer:
This resource is created for my friends underground fight club MLO, it also includes an illegal weapon shop and shooting range.
MLO & ox_lib You can also set the config to use ESX, QB, ND, or any other framework.
ND:
NDCore = exports["ND_Core"]:GetCoreObject()
config = {
winPrize = 10000,
playPrice = 2500,
pay = function(self, source)
local player = NDCore.Functions.GetPlayer(source) -- get player info
if player.cash >= self.playPrice then -- check if can pay
NDCore.Functions.DeductMoney(self.playPrice, source, "cash") -- pay cash
return true -- can pay
end
return false -- can't pay
end,
win = function(self, source)
NDCore.Functions.AddMoney(self.winPrize, source, "cash")
end
}
ESX:
ESX = exports["es_extended"]:getSharedObject()
config = {
winPrize = 10000,
playPrice = 2500,
pay = function(self, source)
local xPlayer = ESX.GetPlayerFromId(source)
local PlayerMoney = xPlayer.getMoney()
if PlayerMoney >= self.playPrice then
xPlayer.removeMoney(self.playPrice)
return true
end
return false
end,
win = function(self, source)
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer then
xPlayer.addMoney(self.winPrize)
end
end
}
QB:
QBCore = exports["qb-core"]:GetCoreObject()
config = {
winPrize = 10000,
playPrice = 2500,
pay = function(self, source)
local Player = QBCore.Functions.GetPlayer(source)
local cash = Player.PlayerData.money["cash"]
if cash >= self.playPrice then
Player.Functions.RemoveMoney("cash", self.playPrice)
return true
end
return false
end,
win = function(self, source)
local Player = QBCore.Functions.GetPlayer(source)
if Player then
Player.Functions.AddMoney("cash", self.winPrize)
end
end
}
Gonna customize for my fight club interior and see if I can get it working for it as we do fight clubs in a few spots in my state. Hopefully people enjoy! Looks great
But that wont stop them from equipping again. Makes it slightly more inconvenient as I have added it and it will remove their weapons each round. But cannot stop them from just pulling one out again and shooting ped.
Ideas?
Just like with the ATM script, people boost so much to get free money because of how easy it can be.
Because people are cheatin’ sons a bishes. Haha.
I will be adding a feature to set the opponents weapon just like the players, and if people are boosting on your server then you shouldn’t make these things high reward. Make them low reward and just in there for fun.
One other concern/question when one series of rounds is complete the ped just sits there (dead or alive) and then when someone else wants to do a round they end up having to fight both and it glitches out of course. Perhaps have a way to add where the ped despawns after a few seconds if it wins or the round series is completed.