feat: 50 игр на Lua + импорт Roblox для всех + поддержка Lua в плеере #39
@ -84,7 +84,7 @@ coinEvent.Event:Connect(function()
|
||||
for _, p in ipairs(Players:GetPlayers()) do
|
||||
local stats = p:FindFirstChild("leaderstats")
|
||||
if stats and stats:FindFirstChild("Монеты") then
|
||||
stats.Монеты.Value = score
|
||||
stats['Монеты'].Value = score
|
||||
end
|
||||
end
|
||||
print("Собрано: " .. score)
|
||||
@ -445,11 +445,11 @@ part.Touched:Connect(function(hit)
|
||||
if not player then return end
|
||||
local stats = player:FindFirstChild("leaderstats")
|
||||
if not stats then return end
|
||||
if stats.Монеты.Value >= 5 then
|
||||
stats.Монеты.Value = stats.Монеты.Value - 5
|
||||
if stats['Монеты'].Value >= 5 then
|
||||
stats['Монеты'].Value = stats['Монеты'].Value - 5
|
||||
local h = hit.Parent:FindFirstChild("Humanoid")
|
||||
if h then h.Health = math.min(h.MaxHealth, h.Health + 50) end
|
||||
print("Купил зелье! +50 HP. Осталось монет: " .. stats.Монеты.Value)
|
||||
print("Купил зелье! +50 HP. Осталось монет: " .. stats['Монеты'].Value)
|
||||
else
|
||||
print("Не хватает монет! Нужно 5")
|
||||
end
|
||||
@ -566,7 +566,7 @@ part.Touched:Connect(function(hit)
|
||||
if not player then return end
|
||||
local stats = player:FindFirstChild("leaderstats")
|
||||
if stats and stats:FindFirstChild("Ключ") then
|
||||
stats.Ключ.Value = true
|
||||
stats['Ключ'].Value = true
|
||||
print("Подобрал ключ!")
|
||||
part:Destroy()
|
||||
end
|
||||
@ -578,7 +578,7 @@ part.Touched:Connect(function(hit)
|
||||
local player = Players:GetPlayerFromCharacter(hit.Parent)
|
||||
if not player then return end
|
||||
local stats = player:FindFirstChild("leaderstats")
|
||||
if stats and stats.Ключ and stats.Ключ.Value then
|
||||
if stats and stats['Ключ'] and stats['Ключ'].Value then
|
||||
print("Сундук открыт! ПОБЕДА!")
|
||||
part.Color = Color3.fromRGB(255, 215, 0)
|
||||
else
|
||||
@ -900,8 +900,8 @@ part.Touched:Connect(function(hit)
|
||||
if not player then return end
|
||||
local stats = player:FindFirstChild("leaderstats")
|
||||
if not stats then return end
|
||||
if stats.Монеты.Value >= price then
|
||||
stats.Монеты.Value = stats.Монеты.Value - price
|
||||
if stats['Монеты'].Value >= price then
|
||||
stats['Монеты'].Value = stats['Монеты'].Value - price
|
||||
bought = true
|
||||
print("Куплено! Цена: " .. price)
|
||||
part.Transparency = 0.7
|
||||
@ -1010,7 +1010,7 @@ end
|
||||
local function onClick(player)
|
||||
local stats = player:FindFirstChild("leaderstats")
|
||||
if stats and stats:FindFirstChild("Клики") then
|
||||
stats.Клики.Value = stats.Клики.Value + 1
|
||||
stats['Клики'].Value = stats['Клики'].Value + 1
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user