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
|
  |
| Joined: 10 Jul 2009 |
| Total Posts: 6702 |
|
| |
|
|
| 07 Dec 2014 06:34 AM |
| You need data persistence or data stores. |
|
|
| Report Abuse |
|
|
Chrapnel
|
  |
| Joined: 01 Feb 2014 |
| Total Posts: 951 |
|
| |
|
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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 10 Jul 2009 |
| Total Posts: 6702 |
|
| |
|