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: Points brick

Previous Thread :: Next Thread 
candy2cave is not online. candy2cave
Joined: 24 Aug 2012
Total Posts: 3552
02 Apr 2014 12:09 PM
I started learning lua but I'm not very good at it yet.
I need a script that I can put into a brick so that is adds points ( to the leaderboard ) but if you've already stepped on it/touched it, it won't give you any points.

~Ipads don't have siggies~
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
02 Apr 2014 12:11 PM
make table
debounce
ontouched
if debounce
local alreadytouched = false
for do loop on the table
check if playername is equal, then set alreadytouched to true
when its checked
use table.insert() on the name of the player on the table.
then put end's
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
02 Apr 2014 12:12 PM
debounce
.Touched event
GetPlayerFromCharacter(object.Parent) or FindFirstChild(object.Parent.Name)

leaderstats

etc
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
02 Apr 2014 12:13 PM
island,

but if you've already stepped on it/touched it, it won't give you any points.

Then it would be possible...
Report Abuse
candy2cave is not online. candy2cave
Joined: 24 Aug 2012
Total Posts: 3552
02 Apr 2014 12:14 PM
Thanks, I'm very bad at this right now,
so what edits do I make to that? ( other than the ends )
Or do I just put it straight in like that?

~Ipads don't have siggies~
Report Abuse
Kingmouli is not online. Kingmouli
Joined: 28 Sep 2012
Total Posts: 1292
02 Apr 2014 12:17 PM
Oh....my....God..
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
02 Apr 2014 12:18 PM
try going to free models.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
02 Apr 2014 12:18 PM
game.Players.PlayerAdded:connect(function(p)
AT = Instance.new("BoolValue",p)
AT.Name = "alreadyTouched"
end)

script.Parent.Touched:connect(function(h)
--assuming u already have leaderboard..
if game.Players:findFirstChild(h.Parent.Name) then
p = game.Players[h.Parent.Name]
P = p.leaderstats.Points
if p.alreadyTouched.Value == false then
p.alreadyTouched.Value = true
P.Value = P.Value+10
end
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