city_hall

Official websites use .boston.gov

A .boston.gov website belongs to an official government organization in the City of Boston.

lock

Secure .gov websites use HTTPS

A lock or https:// means you've safely connected to the .gov website. Share sensitive information only on official, secure websites.

scripts para duelos de asesinos vs sheriffs values
Welcome to Boston Permitting
/
Find everything you need to know about the necessary permits for your projects in the City of Boston.
View the Beta Site

Scripts Para Duelos De Asesinos Vs Sheriffs Values -

The core of the game mode relies on assigning roles correctly.

Script Location: ServerScriptService/TeamManager Purpose: Randomly selects players for the Assassin and Sheriff roles and sets their data values.

-- Services
local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")
-- Configuration Values
local ROLE_ASSASSIN = "Assassin"
local ROLE_SHERIFF = "Sheriff"
local ROLE_INNOCENT = "Innocent"
-- Function to assign roles at the start of a round
local function assignRoles()
	local availablePlayers = Players:GetPlayers()
-- Shuffle table for randomness
	for i = #availablePlayers, 2, -1 do
		local j = math.random(i)
		availablePlayers[i], availablePlayers[j] = availablePlayers[j], availablePlayers[i]
	end
-- Reset all players to Innocent first
	for _, player in ipairs(availablePlayers) do
		local roleValue = player:FindFirstChild("RoleValue") or Instance.new("StringValue")
		roleValue.Name = "RoleValue"
		roleValue.Value = ROLE_INNOCENT
		roleValue.Parent = player
-- Reset Kills/Deaths values
		local kills = player:FindFirstChild("Kills") or Instance.new("IntValue")
		kills.Name = "Kills"
		kills.Value = 0
		kills.Parent = player
	end
-- Assign Assassin
	if #availablePlayers >= 1 then
		local assassin = availablePlayers[1]
		assassin.RoleValue.Value = ROLE_ASSASSIN
		assignWeapon(assassin, "Knife") -- Custom function to give gear
		updateLeaderboard(assassin, "Role", "A")
	end
-- Assign Sheriff
	if #availablePlayers >= 2 then
		local sheriff = availablePlayers[2]
		sheriff.RoleValue.Value = ROLE_SHERIFF
		assignWeapon(sheriff, "Revolver")
		updateLeaderboard(sheriff, "Role", "S")
	end
end
-- Helper: Assign Weapon
function assignWeapon(player, weaponName)
	local weapon = ServerStorage.Weapons:FindFirstChild(weaponName)
	if weapon then
		local clone = weapon:Clone()
		clone.Parent = player.Backpack
	end
end

Not every platform treats "duels" the same. Here is how to adjust scripts para duelos de asesinos vs sheriffs values for your specific use case. scripts para duelos de asesinos vs sheriffs values

local duels = {} -- active duels

RegisterNetEvent("duel:sendRequest") AddEventHandler("duel:sendRequest", function(targetId) local source = source local senderName = GetPlayerName(source) local targetName = GetPlayerName(targetId)

if duels[source] or duels[targetId] then
    TriggerClientEvent("chat:addMessage", source,  args =  "Sistema", "Ya estás en un duelo."  )
    return
end
TriggerClientEvent("duel:receiveRequest", targetId, source, senderName)

end)

RegisterNetEvent("duel:accept") AddEventHandler("duel:accept", function(senderId) local accepter = source if duels[accepter] or duels[senderId] then return end

-- Start duel
duels[senderId] =  opponent = accepter, winner = nil, start = os.time() 
duels[accepter] =  opponent = senderId, winner = nil, start = os.time()
TriggerClientEvent("duel:start", senderId, accepter)
TriggerClientEvent("duel:start", accepter, senderId)

end)

RegisterNetEvent("duel:winner") AddEventHandler("duel:winner", function(winnerId, loserId) if not duels[winnerId] then return end local winner = winnerId local loser = loserId

-- Award rewards
local winnerMoney = Config.Rewards.winnerMoney
local loserMoney = Config.Rewards.loserMoney
-- Add money via your server's economy system
-- Example for ESX/QBCore:
-- exports['esx_addoninventory']:addInventory(...)
TriggerClientEvent("duel:end", winner, "win", loser)
TriggerClientEvent("duel:end", loser, "lose", winner)
-- Cleanup
duels[winner] = nil
duels[loser] = nil
-- Log
print(string.format("[Duel] %s beat %s", GetPlayerName(winner), GetPlayerName(loser)))

end)

RegisterCommand(Config.Commands.forcestop, function(source, args) if IsPlayerAceAllowed(source, "admin") then for k,v in pairs(duels) do TriggerClientEvent("duel:forceStop", k) duels[k] = nil end end end, false)


Back to top