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

Im Trying to make a twitter code script without any expiration date but its not working?

Asked by 4 years ago
Edited 4 years ago

this is a local script

local player = game.Players.LocalPlayer
local RE = game.ReplicatedStorage.EnterCode --EnterCode Is RemoteEvent
local codes = player:WaitForChild("Codes")

local codelist = {
    code1 = "ROBLOX", --Test Codes
    code2 = "Yeet"
}

script.Parent.MouseButton1Click:Connect(function()
    if script.Parent.Parent.CodeHandler.Text == codelist.code1
    then
        if not codes:FindFirstChild ("Code1") then
            RE:FireServer(20, "Code1") --Rewards
            script.Parent.Text = "Code Redeemed Successfully"
            wait(2)
            script.Parent.Text = "Redeem Code"
        else
            script.Parent.Text = "Code Redeemed Successfully"
            wait(2)
            script.Parent.Text = "Redeem Code"          
        end
    else
        script.Parent.Text = "Code Expired"
            wait(2)
            script.Parent.Text = "Redeem Code"
    end
    elseif script.Parent.Parent.CodeHandler.Text == codelist.code2 then
        if not codes:FindFirstChild ("Code2") then
            RE:FireServer(20, "Code2")--Rewards
            script.Parent.Text = "Code Redeemed Successfully"
            wait(2)
            script.Parent.Text = "Redeem Code"
        else
            script.Parent.Text = "Code Redeemed Successfully"
            wait(2)
            script.Parent.Text = "Redeem Code"          
        end

end

end)
1
i cant read the code properly unless you use code block Lightning_Game27 232 — 4y
0
Have you added codes into the player, when the player joins the game? sonicfoo3 19 — 4y
0
I have added codes to the GUI to enter the codes but not to the player IGamez_Tv -8 — 4y

1 answer

Log in to vote
0
Answered by
Borrahh 265 Moderation Voter
4 years ago

THIS IS NOT ANSWER, THIS IS HIS CODE INTO A CODEBLOCK

local player = game.Players.LocalPlayer

local RE = game.ReplicatedStorage.EnterCode --EnterCode Is RemoteEvent

local codes = player:WaitForChild("Codes")

local codelist = {

code1 = "ROBLOX", --Test Codes

code2 = "Yeet"

}

script.Parent.MouseButton1Click:Connect(function()

if script.Parent.Parent.CodeHandler.Text == codelist.code1

then

if not codes:FindFirstChild ("Code1") then

RE:FireServer(20, "Code1") --Rewards

script.Parent.Text = "Code Redeemed Successfully"

wait(2)

script.Parent.Text = "Redeem Code"

else

script.Parent.Text = "Code Redeemed Successfully"

wait(2)

script.Parent.Text = "Redeem Code"

end

else

script.Parent.Text = "Code Expired"

wait(2)

script.Parent.Text = "Redeem Code"

end

elseif script.Parent.Parent.CodeHandler.Text == codelist.code2 then

if not codes:FindFirstChild ("Code2") then

RE:FireServer(20, "Code2")--Rewards

script.Parent.Text = "Code Redeemed Successfully"

wait(2)

script.Parent.Text = "Redeem Code"

else

script.Parent.Text = "Code Redeemed Successfully"

wait(2)

script.Parent.Text = "Redeem Code"

end

end

end)
Ad

Answer this question