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: I don't get what's wrong with this.

Previous Thread :: Next Thread 
michaelofthefuture is not online. michaelofthefuture
Joined: 28 Jun 2008
Total Posts: 793
11 Oct 2012 03:35 PM
It returns no output and there are already values in the player for it.

It is supposed to check if the value (e.x. michaelofthefuture1) is equal to "0" and, if it is, add one to the "Candy" Value.

Otherwise, if the value is equal to "1" it will say: "User already has this item".




local dialog = script.Parent
dialog.DialogChoiceSelected:connect(function(player, choice)
local stats = player:FindFirstChild('leaderstats')
if not stats then return end

local candy = stats:FindFirstChild('Candy')
if not candy then return end

local Value1 = player.""..player.."1"

if choice == script.Parent.DialogChoice.Choice3 then
if Value1.Value == 1 then
print("User already has this item")
elseif Value1.Value == 0 then
candy.Value = candy.Value + 1
Value1.Value = 1
end
end
end)
Report Abuse
blackboy167thst is not online. blackboy167thst
Joined: 22 Jul 2011
Total Posts: 2468
11 Oct 2012 03:36 PM
>local Value1 = player.""..player.."1"

What is this line supposed to be?
Report Abuse
michaelofthefuture is not online. michaelofthefuture
Joined: 28 Jun 2008
Total Posts: 793
11 Oct 2012 03:37 PM
It is supposed to tell the script to look for a value named PLAYERNAME1.
Report Abuse
hamsterloverboy3 is not online. hamsterloverboy3
Joined: 26 Jul 2012
Total Posts: 185
11 Oct 2012 03:38 PM
fail string concatenation
Report Abuse
michaelofthefuture is not online. michaelofthefuture
Joined: 28 Jun 2008
Total Posts: 793
11 Oct 2012 04:20 PM
I need to get this place done by the 15th.
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