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: My Twitter Code gui isn't working properly.

Previous Thread :: Next Thread 
Motioning is not online. Motioning
Joined: 25 Aug 2012
Total Posts: 254
04 Apr 2015 11:10 AM
At first, right when I jump into test mode, it says "Code Declined", and when I enter the correct code, it doesn't do anything.

This is supposed to award a player 50 points when they enter the correct code (found on twitter), but it doesn't. Help?

---------------------------------------------------------------------------------

local box = script.Parent.Parent.CodeBox
local plr = script.Parent.Parent.Parent.Parent

if box.Text == "GimmieDaMonie" then
box.Text = "Code Accepted!"
wait(3)
box.Text = "Redeem Code"
plr.leaderstats.Points.Value = plr.leaderstats.Points.Value + 50
else
box.Text = "Code Declined!"
wait(3)
box.Text = "Redeem Code"
end
Report Abuse
Motioning is not online. Motioning
Joined: 25 Aug 2012
Total Posts: 254
04 Apr 2015 11:12 AM
bump
Report Abuse
Motioning is not online. Motioning
Joined: 25 Aug 2012
Total Posts: 254
04 Apr 2015 11:25 AM
bumped
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
04 Apr 2015 11:26 AM
That checks like right away
Report Abuse
jewelycat is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
04 Apr 2015 11:27 AM
Your whole script runs through and ends instantly.

You probably want this to run when a button is clicked, or the TextLabel is entered in. You need an event.
Report Abuse
Tuneable is not online. Tuneable
Joined: 16 Feb 2013
Total Posts: 2932
04 Apr 2015 11:28 AM
Your issue is that you're checking if the user entered the code on start-up, giving them no time to put in the code. Try wrapping your code (excluding the variables) into a FocusLost event.
Report Abuse
Motioning is not online. Motioning
Joined: 25 Aug 2012
Total Posts: 254
04 Apr 2015 11:30 AM
I have no idea what you mean by that,
Report Abuse
025110 is not online. 025110
Joined: 23 Nov 2012
Total Posts: 57661
04 Apr 2015 11:35 AM
use .FocusLost and use :lower() == "gimidamonie"
Report Abuse
Motioning is not online. Motioning
Joined: 25 Aug 2012
Total Posts: 254
04 Apr 2015 11:37 AM
wot
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
04 Apr 2015 11:41 AM

local box = script.Parent.Parent.CodeBox
local plr = script.Parent.Parent.Parent.Parent

box.FocusLost:connect(function()
if box.Text == "GimmieDaMonie" then
box.Text = "Code Accepted!"
wait(3)
box.Text = "Redeem Code"
plr.leaderstats.Points.Value = plr.leaderstats.Points.Value + 50
else
box.Text = "Code Declined!"
wait(3)
box.Text = "Redeem Code"
end
end)
Report Abuse
Motioning is not online. Motioning
Joined: 25 Aug 2012
Total Posts: 254
04 Apr 2015 11:53 AM
It worked! Thanks! I also have another problem though, players that redeemed it can also redeem it again for 50 more points, how could I fix that?
Report Abuse
jewelycat is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
04 Apr 2015 11:55 AM
After redeeming, save a value to the player that notes they redeemed that code

Check that value before redeeming.
Report Abuse
Motioning is not online. Motioning
Joined: 25 Aug 2012
Total Posts: 254
04 Apr 2015 11:58 AM
I'm not that great at scripting, and I don't know how to code that, could you give me the lines?
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