Готовые решения для твоей игры. Копируй, вставляй, созидай.
Простая проверка серверной частью скорости перемещения игрока.
-- Пример кода из библиотеки Lifehak.Online
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local hum = character:WaitForChild("Humanoid")
hum.Changed:Connect(function()
if hum.WalkSpeed > 32 then
player:Kick("SpeedHack Detected")
end
end)
end)
end)
Самый базовый скрипт для Обби. Убивает игрока при соприкосновении с деталью.
script.Parent.Touched:Connect(function(hit)
local character = hit.Parent
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = 0
end
end)
Поместите этот код в LocalScript внутри Tool в папке StarterPack.
local tool = script.Parent
tool.Equipped:Connect(function()
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 50
end)
tool.Unequipped:Connect(function()
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
end)
Работает на сервере (ServerScriptService). Идеально для симуляторов.
while task.wait(60) do
for _, player in pairs(game.Players:GetPlayers()) do
local stats = player:FindFirstChild("leaderstats")
if stats then
stats.Coins.Value += 10
end
end
end
local MPS = game:GetService("MarketplaceService")
local player = game.Players.LocalPlayer
local ID = 0000000 -- Вставь ID своего геймпаса
script.Parent.MouseButton1Click:Connect(function()
MPS:PromptGamePassPurchase(player, ID)
end)
Основы кода для новичков.
Как монетизировать свои скрипты.