Scripts Para Duelos De Asesinos - Vs Sheriffs Values
local tool = script.Parent
local damage = 100
local ammoValue = tool:WaitForChild("Ammo") -- IntValue inside the gun
tool.Activated:Connect(function()
if ammoValue.Value <= 0 then return end
ammoValue.Value = ammoValue.Value - 1
-- Raycast logic (Simplified)
local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = tool.Parent
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
local origin = tool.Handle.Position
local direction = (mouse.Hit.Position - origin).Unit * 300
local result = workspace:Raycast(origin, direction, raycastParams)
if result then
local hitChar = result.Instance:FindFirstAncestorOfClass("Model")
if hitChar then
local humanoid = hitChar:FindFirstChild("Humanoid")
local victimPlayer = game.Players:GetPlayerFromCharacter(hitChar)
if humanoid and victimPlayer then
local victimRole = victimPlayer.RoleValue
-- VALUE CHECK: Sheriff shooting logic
if victimRole.Value == "Assassin" then
humanoid:TakeDamage(damage)
print("Sheriff eliminated the Assassin!")
-- Trigger Win
elseif victimRole.Value == "Innocent" then
-- Sheriff killing Innocent is usually a harsh penalty
game.Players:GetPlayerFromCharacter(tool.Parent).Character.Humanoid.Health = 0
print("Sheriff killed an Innocent! Suicide penalty.")
end
end
end
end
end)
When crafting an "Assassin vs. Sheriff" script for a game or story, the dramatic tension comes from forcing each side to confront the other’s values.
Antes de escribir un script para el duelo, debemos entender la psicología de cada bando. No es "bueno vs malo"; es Orden vs Caos, pero con matices.
Aquí presento tres scripts clave para duelos Asesino vs Sheriff, cada uno con una lista de "valores en acción" y líneas de diálogo sugeridas. scripts para duelos de asesinos vs sheriffs values
Este es el script principal (Script de Servidor) que se coloca en ServerScriptService. Se encarga de asignar los valores al inicio de la ronda.
Concepto del Script:
El script elige aleatoriamente a los jugadores y modifica sus Values para definir quién es el Asesino y quién el Sheriff. local tool = script
-- Script: ServerScriptService/RoleManagerlocal Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- Función para asignar roles local function asignarRoles() local listaJugadores = Players:GetPlayers() When crafting an "Assassin vs
-- Barajar lista para aleatoriedad for i = #listaJugadores, 2, -1 do local j = math.random(i) listaJugadores[i], listaJugadores[j] = listaJugadores[j], listaJugadores[i] end -- Asignar Asesino (1er lugar) y Sheriff (2do lugar) for i, jugador in ipairs(listaJugadores) do local data = jugador:WaitForChild("PlayerData") local teamValue = data:WaitForChild("Team") if i == 1 then teamValue.Value = "Murderer" -- Asesino -- Dar cuchillo (Herramienta) elseif i == 2 then teamValue.Value = "Sheriff" -- Sheriff -- Dar pistola (Herramienta) else teamValue.Value = "Innocent" -- Inocente end end
end



.avif)

