Mail.ruПочтаМой МирОдноклассникиВКонтактеИгрыЗнакомстваНовостиКалендарьОблакоЗаметкиВсе проекты

Скрипт с покупкой геёмпаса для роблокса.

Степашка Пешков Знаток (255), на голосовании 11 месяцев назад
при касание блока игрок умирает.
Если куплен геймпас то игрок просто возрождается
иначе его кикает с сервера
Дополнен 1 год назад
Код нужно написать на lue по выше прописанному сценарию
Голосование за лучший ответ
Николай Аккерман Профи (535) 1 год назад
В чём вопрос
Максим КовнерУченик (65) 1 год назад
скрипт ему нужен,чтобы если чел касался блока без геймпасса,то ор умирал,а если у него есть геймпасс,то ничего не было бы
нет Мудрец (10405) 1 год назад
Там что ещё и купить что-то возможно? Удивительно! Я сыну в свое время майнкапмф реально купил за 500 рэ - теперь не катит на пс4
*(\/)@Si* Мыслитель (6506) 1 год назад
```python
gamepad_purchased = True # установите для этой переменной значение True, если куплен геймпас, в противном случае установите значение False

if gamepad_purchased:
print("Геймпас куплен. Игрок оживёт при прикосновении блока.")
else:
print("Геймпас не куплен. Игрок будет удалён с сервера, если коснётся блока.")
Егор Знаток (326) 1 год назад
Here's an example script for a game in Roblox that includes a gamepass purchase for reviving the player when they die. The script assumes that there is a block in the game that, when touched, kills the player:
"""
-- Get references to the necessary objects
local block = game.Workspace.Block
local player = game.Players.LocalPlayer
local playerRespawn = game.Workspace.PlayerRespawn
local gamepass = game:GetService("GamePassService"):GetProductInfo(gamepassID)

-- Define the gamepass ID for the revive gamepass
local gamepassID = 12345678

-- Function to handle player death
local function onPlayerDeath()
-- Check if the player has purchased the revive gamepass
if player:FindFirstChild("ReviveGamepass") then
-- Revive the player at the playerRespawn location
player.Character.Humanoid.Health = player.Character.Humanoid.MaxHealth
player.Character:SetPrimaryPartCFrame(playerRespawn.CFrame)
else
-- Kick the player off the server
player:Kick("You did not purchase the revive gamepass!")
end
end

-- Function to handle when the block is touched
local function onBlockTouch(other)
if other == player.Character then
-- Kill the player
player.Character.Humanoid.Health = 0
wait(5) -- Wait for 5 seconds to give the death animation time to play
onPlayerDeath() -- Handle the player's death
end
end

-- Connect the block's touch event to the onBlockTouch function
block.Touched:Connect(onBlockTouch)
"""
In this script, the gamepassID variable is set to the ID of the gamepass that can be purchased to revive the player. When the block is touched, the onBlockTouch function is called and checks if the player has the revive gamepass. If they do, the onPlayerDeath function revives the player at a predefined respawn location. If they don't have the gamepass, the onPlayerDeath function kicks the player off the server.

Note that this script assumes that the revive gamepass has been created in the Roblox studio and assigned the ID gamepassID. The GamePassService object is used to retrieve information about the gamepass, and the player:FindFirstChild function is used to check if the player has purchased the gamepass. If the gamepass does not exist or the ID is incorrect, the script will not function correctly.
Похожие вопросы