Код IT
← Каталог

Roblox / Luau — скрипты для новичков — CoinClient (клиент)

Фрагмент из «Roblox / Luau — скрипты для новичков»: CoinClient (клиент).

Lua main.lua
--!strict

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserInputService = game:GetService("UserInputService")
local event = ReplicatedStorage:WaitForChild("AddCoinRequest") :: RemoteEvent

UserInputService.InputBegan:Connect(function(input, processed)
    if processed then
        return
    end
    if input.KeyCode == Enum.KeyCode.E then
        event:FireServer()
    end
end)
--!strict

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserInputService = game:GetService("UserInputService")
local event = ReplicatedStorage:WaitForChild("AddCoinRequest") :: RemoteEvent

UserInputService.InputBegan:Connect(function(input, processed)
    if processed then
        return
    end
    if input.KeyCode == Enum.KeyCode.E then
        event:FireServer()
    end
end)