Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Twitter Code Script is not working correctly, why?

Asked by
Qawstar 32
5 years ago

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)
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 Lolamtic 63 — 5y
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. luachef 61 — 5y
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. Qawstar 32 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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)
0
Thank you, worked! Qawstar 32 — 5y
0
thank me is now easy add twitter code in me game Lolamtic 63 — 5y
0
If you really did copy my script, congratulations!: You are the worst scripter ever. Qawstar 32 — 5y
Ad

Answer this question