Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 7 years ago
Edited by M39a9am3R 7 years ago
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)

0
Please use the code block. User#14829 0 — 7y
0
Are you asking how to use PointsService? OldPalHappy 1477 — 7y
0
Use a code block! SH_Helper 61 — 7y
0
Edited for Code Block M39a9am3R 3210 — 7y

3 answers

Log in to vote
0
Answered by 7 years ago

You need to create a value inside the player. Here is some help with that. http://wiki.roblox.com/index.php?title=Leaderboard

Then, just change the value within the player once they touch it.

Ad
Log in to vote
0
Answered by
Netflixy 126
7 years ago

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

Log in to vote
-1
Answered by 7 years ago

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

Answer this question