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