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 » Game Design
Home Search
 

Re: How to make a Point Script only ever work once for a player

Previous Thread :: Next Thread 
namakuji is not online. namakuji
Joined: 10 Jul 2009
Total Posts: 6702
07 Dec 2014 05:09 AM
I want to make a brick that gives you Points (Rings) but you can only ever use the button once for each player, even if you close it down/go on a new server.
Here is the Script I currently have:

local ting = 0

function onTouched(hit)

if ting == 0 then
ting = 1 --activate debounce
check = hit.Parent:FindFirstChild("Humanoid")

if check ~= nil then

local user = game.Players:GetPlayerFromCharacter(hit.Parent)
local stats = user:findFirstChild("leaderstats")

if stats ~= nil then
local cash = stats:findFirstChild("Rings")
cash.Value = cash.Value +1
wait(5)
end

end

ting = 0
end

end

script.Parent.Touched:connect(onTouched)
Report Abuse
namakuji is not online. namakuji
Joined: 10 Jul 2009
Total Posts: 6702
07 Dec 2014 05:56 AM
Bump, I need help!
Report Abuse
Superwarrior360 is not online. Superwarrior360
Joined: 21 Feb 2013
Total Posts: 2703
07 Dec 2014 06:34 AM
You need data persistence or data stores.
Report Abuse
Chrapnel is not online. Chrapnel
Joined: 01 Feb 2014
Total Posts: 951
07 Dec 2014 06:37 AM
Wrong forum.
Report Abuse
namakuji is not online. namakuji
Joined: 10 Jul 2009
Total Posts: 6702
07 Dec 2014 07:02 AM
How could I use Data Stores/Persistance to do this?
Report Abuse
SundownMKII is not online. SundownMKII
Joined: 26 Sep 2010
Total Posts: 12880
07 Dec 2014 07:37 AM
Look at the Wiki: http://wiki.roblox.com/index.php?title=Data_store

You'll want a friend or two to try and help you out on this one, since it's going to be client-side only.

Bonus points - you can use Data Stores to keep track of a player's progress.

Since I don't know how to use Data Stores, I can only link that to you. Don't use Data Persistence - it's mostly (if not fully) deprecated and is only being kept around as a legacy feature for older games.
Report Abuse
namakuji is not online. namakuji
Joined: 10 Jul 2009
Total Posts: 6702
07 Dec 2014 08:31 AM
Can someone please edit the script, I've looked on the wiki and i'm not sure what needs to be added :/
Report Abuse
namakuji is not online. namakuji
Joined: 10 Jul 2009
Total Posts: 6702
07 Dec 2014 08:45 AM
Please Help
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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