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 » Scripters
Home Search
 

Point Earning Button Problems

Previous Thread :: Next Thread 
JosephTheAmaze is not online. JosephTheAmaze
Joined: 29 Jan 2014
Total Posts: 268
11 Nov 2016 12:33 AM
I did a leaderboard script, so then I decided to do a point earning button, but every time I try and touch it, I get no points on the leaderboard here's the script I have.

game.Players.PlayerAdded:connect(function(player)
local leader, score = Instance.new('IntValue'), Instance.new('IntValue')
leader.Name = 'leaderstats'
score.Name = 'Score'
score.Parent = leader
leader.Parent = player
end)

Workspace.Button.Touched:connect(function(hit)
local p = game.Players:FindFirstChild(hit.Parent.Name)
if pl and enabled == true then
enabled = false
p.leaderstats.Score.Value = p.leaderstats.Score.Value + 5
wait(20)
enabled = true
end
end)




If anything's wrong with this please correct me on this
Report Abuse
JosephTheAmaze is not online. JosephTheAmaze
Joined: 29 Jan 2014
Total Posts: 268
11 Nov 2016 12:34 AM
I also inserted that script into a part, so if that was wrong then idk
Report Abuse
sharpchain1 is not online. sharpchain1
Joined: 05 Aug 2013
Total Posts: 1009
11 Nov 2016 12:49 AM
well in the script u posted above it says "if pl" and you never made a variable called pl thats the only thing i see wrong with it are there any errors? Also i suggest using the 'GetPlayerFromCharacter()' method instead of FindfirshChild() In getPlayerFromCharacter you put the character model as a parameter instead of the player's name. here wiki page for it http://wiki.roblox.com/index.php?title=API:Class/Players/GetPlayerFromCharacter


R$5,623
Report Abuse
JosephTheAmaze is not online. JosephTheAmaze
Joined: 29 Jan 2014
Total Posts: 268
11 Nov 2016 12:51 AM
weird, cause I checked the cookbook to see if I was wrong or right. And it said the same thing. But ok, I'll try your method
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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