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: StringValue?

Previous Thread :: Next Thread 
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
21 Jun 2014 02:02 AM
Is it possible to DataStore StringVales?
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
21 Jun 2014 02:42 AM
Strings yes
StringValues no
Report Abuse
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
21 Jun 2014 03:20 AM
Well, I changed it to an "IntValue".

So what's wrong with this, after it minuses by two seconds the value changes right to 0:
local Player = Game.Players.LocalPlayer
local CashPLAYER = Player:WaitForChild("CashPLAYER");
local LevelPLAYER = Player:WaitForChild("LevelPLAYER");
local Timer = Player:WaitForChild("Timer");
local PlayerGui = Player:WaitForChild("PlayerGui"):WaitForChild("Menu");
local Notification = PlayerGui.TextLabel5

Timer.Value = 15

while Timer.Value > 0 do
Timer.Value = Timer.Value - 1
if Timer.Value == 0 and Player ~= nil then
Timer.Value = 15
CashPLAYER.Value = CashPLAYER.Value + 75
Notification.Visible = true
wait(3)
Notification.Visible = false
end
wait(1)
end
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
21 Jun 2014 03:23 AM
Try this instead of the while loop:

while true do
repeat
Timer.Value = Timer.Value - 1
CashPLAYER.Value = CashPLAYER.Value + 75
Notification.Visible = true
wait(3)
Notification.Visible = false
wait(1)
until
Timer.Value == 0
if Timer.Value == 0 and Player ~= nil then
Timer.Value = 15
end
end


Idk
Report Abuse
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
21 Jun 2014 03:27 AM
That made the player cash increase every second. And then made the seconds minus by negatives...

Can anyone fix this?
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
21 Jun 2014 03:29 AM
What, did it start at 15 seconds then go negative?
Report Abuse
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
21 Jun 2014 03:30 AM
Yes...
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
21 Jun 2014 03:35 AM
I dont see anything wrong with the script... are you sure you dont have a different script affecting Timer?
Report Abuse
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
21 Jun 2014 03:37 AM
Is something that could be doing that:

local Player = script.Parent.Parent.Parent.Parent.Parent
local Timer = Player:WaitForChild("Timer");

while true do
script.Parent.Text = Timer.Value
wait()
end
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
21 Jun 2014 03:41 AM
No that isnt it.
Report Abuse
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
21 Jun 2014 03:43 AM
The timer is an "IntValue". Witch is DataStored. I figured all the other DataStoring cash and level works so this should? Could it because it's and IntValue or DataStored?
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
21 Jun 2014 03:44 AM
Unless you're updating the timer by using :GetAsync every time you save,no..
Report Abuse
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
21 Jun 2014 03:46 AM
That's probably why. What shall I use? By the way, thanks for helping!
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
21 Jun 2014 03:49 AM
:UpdateAsync
Report Abuse
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
21 Jun 2014 03:53 AM
Timer.Value = Data28:UpdateAsync("UserTimer_"..Player.userId) or 15

It goes nil...
Am I doing something wrong?
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
21 Jun 2014 03:56 AM
Actually dont bother getting the Timer.Value from datastore. delete that line altogether
Report Abuse
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
21 Jun 2014 03:57 AM
What do you mean? Just remove Timer.Value?

Data28:UpdateAsync("UserTimer_"..Player.userId) or 15
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
21 Jun 2014 03:59 AM
This entire line

"Timer.Value = Data28:UpdateAsync("UserTimer_"..Player.userId) or 15"

its unneeded
Report Abuse
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
21 Jun 2014 04:01 AM
Well then how could It be saved?
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
21 Jun 2014 04:02 AM
why exactly do you need to save the timer?
Report Abuse
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
21 Jun 2014 04:04 AM
Once the player dies, the timer resets. Or if I want to change the time to like 3 hours then it wont save. 15 seconds its just for testing.
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
21 Jun 2014 04:09 AM
just change Timer.Value then
Report Abuse
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
21 Jun 2014 04:10 AM
You told me to remove that...
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
21 Jun 2014 04:14 AM
I mean set it directly
Timer.Value = 15
No need to use complicated things like DataStore for it
Also in this case if you want to save

D28:SetAsync("Timer", Timer.Value)
Report Abuse
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
21 Jun 2014 04:19 AM
This is not working...I do everything you say!
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