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
 

Re: For some reason, this datastore if statement only does

Previous Thread :: Next Thread 
Pen54321 is not online. Pen54321
Joined: 11 Jul 2012
Total Posts: 8894
05 Jan 2016 05:34 PM
the same thing, which is basically stay as sell. Do you know how I can make it so it can be BUY instead. Here are the updateAsyncs and if statement.

if (Building0Owner:GetAsync(key, p)) then
script.Parent.Text = "SELL"
else
script.Parent.Text = "BUY"
end

Building0Owner:UpdateAsync(key, function(oldValue)
local newValue = oldValue or p
newValue = "NotOwned"
return newValue
end)

Building0Owner:UpdateAsync(key, function(oldValue)
local newValue = oldValue or "NotOwned"
newValue = p
return newValue
end)

Report Abuse
Pen54321 is not online. Pen54321
Joined: 11 Jul 2012
Total Posts: 8894
05 Jan 2016 05:44 PM
bump

Report Abuse
Pen54321 is not online. Pen54321
Joined: 11 Jul 2012
Total Posts: 8894
05 Jan 2016 06:02 PM
bump

Report Abuse
Pen54321 is not online. Pen54321
Joined: 11 Jul 2012
Total Posts: 8894
05 Jan 2016 06:15 PM
bump

Report Abuse
Pen54321 is not online. Pen54321
Joined: 11 Jul 2012
Total Posts: 8894
05 Jan 2016 06:21 PM
bump

Report Abuse
Pen54321 is not online. Pen54321
Joined: 11 Jul 2012
Total Posts: 8894
05 Jan 2016 06:37 PM
bump

Report Abuse
icanxlr8 is not online. icanxlr8
Joined: 25 Feb 2009
Total Posts: 3686
05 Jan 2016 06:45 PM
if (Building0Owner:GetAsync(key, p) == value) then -- Replace value with what you want it to equal, without this it fires whenever it receives any value.
script.Parent.Text = "SELL"
else
script.Parent.Text = "BUY"
end

Building0Owner:UpdateAsync(key, function(oldValue)
local newValue = oldValue or p
newValue = "NotOwned"
return newValue
end)

Building0Owner:UpdateAsync(key, function(oldValue)
local newValue = oldValue or "NotOwned"
newValue = p
return newValue
end)

Rock on! http://www.roblox.com/games/121584089/Rock-Roleplay
Report Abuse
Pen54321 is not online. Pen54321
Joined: 11 Jul 2012
Total Posts: 8894
05 Jan 2016 07:20 PM
Thank you.

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