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)
매개 변수
코드 샘플
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.
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)