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: fix this for 100rs

Previous Thread :: Next Thread 
Succulence is not online. Succulence
Joined: 24 Sep 2012
Total Posts: 1437
08 Jun 2014 02:09 AM
local PointsService = Game:GetService("PointsService")

script.Parent.MouseClick:connect(function(player)
if player:WaitForChild('leaderstats'):WaitForChild('Credits').Value >= 0 then
pcall(function()
local pointsToAward = PointsService:GetAwardablePoints()
if pointsToAward > 50 then
PointsService:AwardPoints(player.userId, 50)
player.leaderstats.Credits.Value = player.leaderstats.Credits.Value - 0
end
print('awarded')
end)
end
end)
player.Character:BreakJoints()



Doesnt award points, Doesnt BreakJoints

Why?
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
08 Jun 2014 02:27 AM
local PointsService = Game:GetService("PointsService")

script.Parent.MouseClick:connect(function(player)
if player:WaitForChild('leaderstats'):WaitForChild('Credits').Value >= 0 then
pcall(function()
local pointsToAward = PointsService:GetAwardablePoints()
if pointsToAward > 50 then
PointsService:AwardPoints(player.userId, 50)
player.leaderstats.Credits.Value = player.leaderstats.Credits.Value - 0
end
print('awarded')
end)
end
player.Character:BreakJoints()
end)


Maybe cause there are no points ingame.
Report Abuse
Succulence is not online. Succulence
Joined: 24 Sep 2012
Total Posts: 1437
08 Jun 2014 04:27 AM
there are points ingame
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
08 Jun 2014 04:29 AM
MouseClick Returns nothing. This should work:

script.Parent.MouseClick:connect(function()
if game.Players.LocalPlayer:WaitForChild('leaderstats'):WaitForChild('Credits').Value >= 0 then
pcall(function()
local pointsToAward = PointsService:GetAwardablePoints()
if pointsToAward > 50 then
PointsService:AwardPoints(game.Players.LocalPlayer.userId, 50)
game.Players.LocalPlayer.leaderstats.Credits.Value = game.Players.LocalPlayer.leaderstats.Credits.Value - 0
end
print('awarded')
end)
end
game.Players.LocalPlayer.Character:BreakJoints()
end)
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
08 Jun 2014 04:56 AM
@youssef yes it does nub

script.Parent.ClickDetector.MouseClick
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