Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Twitter Code Script is not working correctly, why?

Hello!

So, I'm trying to create an Twitter Code script which would give free items when given the right code. But when I write the right code, it still says "Incorrect code!" which is supposed to be used ONLY when you have writen the wrong code. So, please HELP!

Here's the script!:

local storage = game.ReplicatedStorage
local item = storage:FindFirstChild("Better Sword")

script.Parent.MouseButton1Click:Connect(function()
	if script.Parent.Parent.TextBox == "firstcode" then
		script.Parent.Parent.TextLabel.Text = "Correct code!"
		wait(5)
	script.Parent.Parent.TextLabel.Text = "To find codes, pleae visit my TWITTER!: @TIKUTERs"
	wait(1)
		item:Clone().Parent = game.Players.LocalPlayer.Backpack
		item:Clone().Parent = game.Players.LocalPlayer.StarterGear
		print("Correct code given!")
	else
		script.Parent.Parent.TextLabel.Text = "Incorrect code!"
		wait(5)
		script.Parent.Parent.TextLabel.Text = "To find codes, pleae visit my TWITTER!: @TIKUTERs"
		print("Incorrect code given!")
	end
end)

3 comments

0

Hi im experiencing a problem with your Koala Cafe game it also breaks a record its the first roblox game i have a consistant 9 fps on lowest graphics are you proud now! and on max graphics i have 4.4 fps

0

Even if you do find a way to fix this, i would highly recommend to remake your script. It is not filtering enabled compatible. And i should say that there are currently no popular games with filtering disabled.

0

Hey lola, I'm pretty sure that this is the wrong place to complain about the cafe being laggy! :) And also Luachef, it workes with FE.

1 answer

✓ Accepted answer

Hi!

Your script seems to work fine, except for the part where you actually check the code. Your attempt was:

if script.Parent.Parent.TextBox == "firstcode" then

This checks if the Textbox object equals a string, which obviously, it does not! Try adding ".Text" to it and see if it works then!

Full code:

local storage = game.ReplicatedStorage
local item = storage:FindFirstChild("Better Sword")

script.Parent.MouseButton1Click:Connect(function()
    if script.Parent.Parent.TextBox.Text == "firstcode" then
        script.Parent.Parent.TextLabel.Text = "Correct code!"
        wait(5)
    script.Parent.Parent.TextLabel.Text = "To find codes, pleae visit my TWITTER!: @TIKUTERs"
    wait(1)
        item:Clone().Parent = game.Players.LocalPlayer.Backpack
        item:Clone().Parent = game.Players.LocalPlayer.StarterGear
        print("Correct code given!")
    else
        script.Parent.Parent.TextLabel.Text = "Incorrect code!"
        wait(5)
        script.Parent.Parent.TextLabel.Text = "To find codes, pleae visit my TWITTER!: @TIKUTERs"
        print("Incorrect code given!")
    end
end)

3 comments

0

Thank you, worked!

0

thank me is now easy add twitter code in me game

0

If you really did copy my script, congratulations!: You are the worst scripter ever.

This discussion is preserved as it was. New answers, comments, and votes are closed.