generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: I need help scripting a points awarder.

Previous Thread :: Next Thread 
KnightlyKnave is not online. KnightlyKnave
Joined: 31 Dec 2012
Total Posts: 10
25 Apr 2014 06:38 PM
Hello, I am currently working on a game that sells t-shirts for points, I have run into some difficulty with the scripting, I want to know if anyone knows, how do I make a pad that awards the player points after they have bought one of the the t-shirts? The only script I have been able to find is this one

-- declare service
local PointsService = Game:GetService("PointsService")

-- Bind function to player added event
game.Players.PlayerAdded:connect(function(player)
-- Get total number of points the game has available
local pointsToAward = PointsService:GetAwardablePoints()
-- Get total number of points this game has already awarded to the player
local universeBalance = PointsService:GetGamePointBalance(player.userId)
-- Check if the game has points to award and if the player hasn't gotten any points yet. If both are true, then give the player a point.
if ( pointsToAward > 0 and universeBalance == 0) then
PointsService:AwardPoints(player.userId, 1)
end
end)

-- Bind function to when points are successfully awarded
PointsService.PointsAwarded:connect(function(userId, userBalanceinUni, userBalance)
-- Show message indicating that a player has gotten points
local message = Instance.new('Message', game.Workspace)
message.Text = "Point awarded to " .. userId .. ". This player now has " .. userBalance .. " points total!"
wait(5)
message:Destroy()
end)


How do I update this to be awarded by touch of a brick, or as a reward for a shirt being bought?
Report Abuse
Aurazona is not online. Aurazona
Joined: 18 Jan 2014
Total Posts: 1220
25 Apr 2014 06:48 PM
I'm looking for the same thing qq
Report Abuse
TheProgrammingMaster is not online. TheProgrammingMaster
Joined: 20 Aug 2011
Total Posts: 7602
25 Apr 2014 06:49 PM
This is pointless you know? They are suppose to be awarded for DOING things in the game, your not suppose to BUY POINTS.
Report Abuse
Aurazona is not online. Aurazona
Joined: 18 Jan 2014
Total Posts: 1220
25 Apr 2014 07:57 PM
Who cares, buying points is easier.
Report Abuse
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
25 Apr 2014 08:04 PM
Who cares if its easier its stupid.
Report Abuse
Aurazona is not online. Aurazona
Joined: 18 Jan 2014
Total Posts: 1220
25 Apr 2014 08:06 PM
Whatever.

I can't judge people's opinion, and you can't judge either.
Report Abuse
Halpar is not online. Halpar
Joined: 21 Apr 2014
Total Posts: 91
25 Apr 2014 08:10 PM
function OnTouched()
wait()
local points = game:GetService 'PointsService' :GetAwardablePoints()

if points > 0 then
game:GetService 'PointsService' :AwardPoints(4812582, points)
end
end
script.Parent.Touched:connect(onTouched)
Report Abuse
Halpar is not online. Halpar
Joined: 21 Apr 2014
Total Posts: 91
25 Apr 2014 08:11 PM
above might or might not work .

so yeah L0L
Report Abuse
KnightlyKnave is not online. KnightlyKnave
Joined: 31 Dec 2012
Total Posts: 10
25 Apr 2014 10:31 PM
thank you, ill try it to see if it works
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image