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: Point giver with ClickDetector

Previous Thread :: Next Thread 
GraniteSphere is not online. GraniteSphere
Joined: 09 Aug 2012
Total Posts: 237
31 Jan 2013 05:07 PM
I'm working on a game and i'm trying to make a button that gives points when clicked.
could i have some help with that?
Report Abuse
YellowBrick1 is not online. YellowBrick1
Joined: 06 May 2009
Total Posts: 865
31 Jan 2013 05:09 PM
I don't believe ClickDetectors give exact points when clicked.
Report Abuse
Jonah13249 is not online. Jonah13249
Joined: 09 Oct 2009
Total Posts: 2105
31 Jan 2013 05:10 PM
Help? The event MouseClick used with ClickDetectors returns the player. Ex:

Part.ClickDetector.MouseClick:connect(function (player)
print(player.Name)
end)

All you have to do is find the stats or points and just add to it.

~ṡсɾïρτïṉģ hεlρεɾṡ ۩ lυαlεαɾṉεɾṡ ④ øƒвќṃṿј~ ღ ▂▃▅▆█ρεώḋïερïε☄сυτïερïε█▆▅▃▂ღ 【▬】
Report Abuse
Saltless is not online. Saltless
Joined: 24 Dec 2012
Total Posts: 107
31 Jan 2013 05:11 PM
Insert it into the brick.


    script.Parent.ClickDetector.MouseClick:connect(function(player)
      repeat wait() until player.leaderstats and player.leaderstats.YOURPOINTSNAME
      points = player.leaderstats.YOURPOINTSNAMES
      points.Value = points.Value + 5
    end)
Report Abuse
YellowBrick1 is not online. YellowBrick1
Joined: 06 May 2009
Total Posts: 865
31 Jan 2013 05:13 PM
Sorry, I misunderstood what you meant by 'points'. I thought you meant a Vector3 point, you meant a score point.
Report Abuse
GraniteSphere is not online. GraniteSphere
Joined: 09 Aug 2012
Total Posts: 237
31 Jan 2013 05:19 PM
Thank you very much Saltless
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
31 Jan 2013 05:43 PM
Saltless's error verification is wrong, which shouldn't matter too much. Here's my fix.

script.Parent.ClickDetector.MouseClick:connect(function(Player)
if Player and Player:FindFirstChild("leaderstats") and Player.leaderstats:FindFirstChild("YOURPOINTSNAME") then
Player.leaderstats.YOURPOINTSNAME.Value = Player.leaderstats.YOURPOINTSNAME.Value + 5
else
print("Could not identify Player's leaderstat or point value!")
end
end)
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