PointsService

사용되지 않는 항목 표시

*이 콘텐츠는 AI(베타)를 사용해 번역되었으며, 오류가 있을 수 있습니다. 이 페이지를 영어로 보려면 여기를 클릭하세요.

만들 수 없음
서비스
사용되지 않음

PointsService 클래스는 포인트를 제어합니다.

포인트는 Roblox에서 플레이어의 업적과 참여를 보여주는 시상 시스템입니다. 이 서비스를 통해 어떻게 포인트가 획득되는지는 게임 개발자의 재량입니다.

요약

이벤트

  • PointsAwarded(userId : number,pointsAwarded : number,userBalanceInGame : number,userTotalBalance : number):RBXScriptSignal

    플레이어에게 포인트를 성공적으로 할당한 때에 발생하며, 플레이어가 현재 게임과 모든 게임에 대한 업데이트된 포인트 균형을 통과합니다.

속성

메서드

이벤트

PointsAwarded

이 이벤트는 플레이어에게 포인트를 성공적으로 할당한 때에 발생하며, 플레이어가 현재 게임 및 모든 게임에 대한 업데이트된 포인트 균형을 통해 전달됩니다.

플레이어에게 포인트가 성공적으로 지급되면 아래 예시에서 사용자 아이디와 새 포인트 잔액을 인쇄합니다. 예를 들어, Roblox 계정이 30개의 포인트를 성공적으로 받았으면 첫 번째 항목에 대한 포인트 잔액을 인쇄하지 않습니다.

사용자: 1은 이제 현재 게임에서 30 (+30)포인트를 획득하여 총 잔액을 만들었습니다.

인쇄됩니다.


local function pointsAwarded(userId, pointsAwarded, userBalanceInGame, userTotalBalance)
print("User: " .. userId .. " has now earned " .. userBalanceInGame .. " (+" .. pointsAwarded ..") points in the current game, now making their total balance " .. userTotalBalance)
end
game:GetService("PointsService").PointsAwarded:Connect(pointsAwarded)

매개 변수

userId: number
pointsAwarded: number
userBalanceInGame: number
userTotalBalance: number

코드 샘플

When a player is awarded points successfully the below example would print the userId and their new point balance. If, for example, the Roblox account was awarded thirty points (and had none to begin with) "User: 1 has now earned 30 (+30) points in the current game, now making their total balance 30" would be printed.

PointsService.PointsAwarded

local PointsService = game:GetService("PointsService")
local function onPointsAwarded(userId, pointsAwarded, userBalanceInGame, userTotalBalance)
print(
"User:",
userId,
"has now earned",
userBalanceInGame,
"(+",
pointsAwarded,
") points in the current game, now making their total balance",
userTotalBalance
)
end
PointsService.PointsAwarded:Connect(onPointsAwarded)