Taller Lua

Catálogo/Puerta de monedas

EconomíaMedio

Puerta de monedas

Una puerta bloquea el paso. Quien tiene suficientes monedas las gasta y la puerta desaparece solo para esa ronda.

Valores

Dónde va

  1. 01

    Leaderstats

    Necesitas Monedas (Mini Obby o script de leaderstats).

  2. 02

    Este script

    La puerta aparece en (0, 10, -24). Muévela al pasillo que quieras cobrar.

Explorer → ServerScriptServiceScriptPuertaMonedas

PuertaMonedas.luaScript
--[[
  Puerta de monedas · Taller Lua
  Pega este Script en ServerScriptService y pulsa Play.
  Es para TU juego en Roblox Studio — no es un exploit.
]]

local Players = game:GetService("Players")

local COST = 20

local old = workspace:FindFirstChild("TallerDoor")
if old then
	old:Destroy()
end

local door = Instance.new("Part")
door.Name = "TallerDoor"
door.Anchored = true
door.Size = Vector3.new(12, 10, 1)
door.CFrame = CFrame.new(0, 10, -24)
door.Color = Color3.fromRGB(72, 78, 88)
door.Material = Enum.Material.Slate
door.Parent = workspace

local gui = Instance.new("BillboardGui")
gui.Size = UDim2.fromOffset(160, 40)
gui.StudsOffset = Vector3.new(0, 7, 0)
gui.AlwaysOnTop = true
gui.Parent = door
local text = Instance.new("TextLabel")
text.BackgroundTransparency = 1
text.Size = UDim2.fromScale(1, 1)
text.Font = Enum.Font.SourceSansBold
text.Text = COST .. " MONEDAS"
text.TextColor3 = Color3.new(1, 1, 1)
text.TextScaled = true
text.Parent = gui

local opened = {}

door.Touched:Connect(function(hit)
	local player = Players:GetPlayerFromCharacter(hit.Parent)
	if not player or opened[player.UserId] then
		return
	end
	local stats = player:FindFirstChild("leaderstats")
	local coins = stats and stats:FindFirstChild("Monedas")
	if not coins or coins.Value < COST then
		return
	end
	coins.Value -= COST
	opened[player.UserId] = true
	door.CanCollide = false
	door.Transparency = 0.7
	text.Text = "ABIERTA"
	task.delay(8, function()
		door.CanCollide = true
		door.Transparency = 0
		text.Text = COST .. " MONEDAS"
		opened[player.UserId] = nil
	end)
end)