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)
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.
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)
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