Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a point rewarding system with a popup on the side "You got rewarded a point!"?

local group = 2718024
local rank = 3

script.Parent.ClickDetector.MouseClick:connect(function(playerWhoClicked)
    if playerWhoClicked:GetRankInGroup(group) == rank then --Checks whether the player meets these conditions
        script.Parent.ClickDetector.MaxActivationDistance = 0 --'Disables' clicking
        script.Parent.Transparency = 1 --Transparent
        wait(300) --Wait 5 minutes
        script.Parent.Transparency = 0 --Opaque
        script.Parent.ClickDetector.MaxActivationDistance = 32 --Default distance
    end
end)

This is the script where only the person with the rank "Janitor" can click on the "dirt" block & it will go fully transparent as if they cleaned it up.

I want it where when they click on it they get rewarded 1 point (point leaderboard) & there is a little GUI popup on the side saying "You got rewarded a point!"

(this might be hard so sorry)

4 comments

0

Please use the code block.

0

Are you asking how to use PointsService?

0

Use a code block!

0

Edited for Code Block

3 answers

Use the function AwardPoints

game:GetService("PointsService"):AwardPoints(player.userId, 1)

That would give someone 1 point.

Updated script:

local group = 2718024
local rank = 3

script.Parent.ClickDetector.MouseClick:connect(function(playerWhoClicked)
    if playerWhoClicked:GetRankInGroup(group) == rank then --Checks whether the player meets these conditions
        script.Parent.ClickDetector.MaxActivationDistance = 0 --'Disables' clicking
        script.Parent.Transparency = 1 --Transparent
        wait(300) --Wait 5 minutes
        script.Parent.Transparency = 0 --Opaque
        script.Parent.ClickDetector.MaxActivationDistance = 32 --Default distance
		game:GetService("PointsService"):AwardPoints(playerWhoClicked.userId, 1) --Award the player 1 point
    end
end)

Wiki

1.Make a ScreenGui with the message 2.Use .Changed on your stats(youcould use something else if you want to.. 3.do your new value - the old value to get how many points that the player got. 4. Make the text on your textlabel equal to how much cash the player received

This discussion is preserved as it was. New answers, comments, and votes are closed.