I want to remove this code
if date["year"]== and date["month"] == and date["day"] <=
but then the elseif appeared red
and the error said "Expected ‘)’ (to close at ‘)’ at line 14), got ‘elseif’
Here is the code when i remove the “if date[“year”]== and date[“month”] == and date[“day”] <=”:
local player = game.Players.LocalPlayer
local RE = game.ReplicatedStorage.EnterCode
local codes = player:WaitForChild("Codes")
--Optional if you want your code to have an expiration
local date = os.date("*t", os.time())
--Codes
local codelist = {
code1 = "BIGGESTUPDATE", -- Always put a comma every timne you're going to add another code
code2 = "TWITTER"
}
script.Parent.MouseButton1Click:Connect(function()
if script.Parent.Parent.CodeHandler.Text == codelist.code1 then -- Im gonna add an expiration in this code
if not codes:FindFirstChild("Code1") then -- This one here
RE:FireServer(5000, "Code1") -- The string must be the same as in the top. For now I can reward the player, cash. Until I can learn how to save tools.
script.Parent.Text = "Code redeemed successfully!"
script.Parent.Parent.CodeHandler.Text = "" -- Removes the text in our code handler textbox
wait(2)
script.Parent.Text = "Redeem Code"
else
script.Parent.Text = "Code already redeemed!"
wait(2)
script.Parent.Text = "Redeem Code"
end
else
script.Parent.Text = "Code expired!"
wait(2)
script.Parent.Text = "Redeem Code"
end
end
elseif script.Parent.Parent.CodeHandler.Text == codelist.code2 then -- Your second code. So if our textbox matches the code in our dictionary...
if not codes:FindFirstChild("Code2") then -- This one here
RE:FireServer(3000, "Code2") -- The string must be the same as in the top. For now I can reward the player, cash. Until I can learn how to save tools.
script.Parent.Text = "Code redeemed successfully!"
script.Parent.Parent.CodeHandler.Text = ""
wait(2)
script.Parent.Text = "Redeem Code"
else
script.Parent.Text = "Code already redeemed!"
wait(2)
script.Parent.Text = "Redeem Code"
end
else
script.Parent.Text = "Code invalid!"
script.Parent.Parent.CodeHandler.Text = ""
wait(2)
script.Parent.Text = "Redeem Code"
end
end)
and remember the elseif is red
and here is the code with the “if date[“year”]== and date[“month”] == and date[“day”] <=”:
local player = game.Players.LocalPlayer
local RE = game.ReplicatedStorage.EnterCode
local codes = player:WaitForChild("Codes")
--Optional if you want your code to have an expiration
local date = os.date("*t", os.time())
--Codes
local codelist = {
code1 = "BIGGESTUPDATE", -- Always put a comma every timne you're going to add another code
code2 = "TWITTER"
}
script.Parent.MouseButton1Click:Connect(function()
if script.Parent.Parent.CodeHandler.Text == codelist.code1 then -- Im gonna add an expiration in this code
if date["year"]== 2020 and date["month"] == 5 and date["day"] <= 30 then -- Months are in numerical order .Month and Day must be in lowercase letters. Use "<=" If you want to make your code valid until that date. Use "==" if you want to make your code valid only on that date.
if not codes:FindFirstChild("Code1") then -- This one here
RE:FireServer(5000, "Code1") -- The string must be the same as in the top. For now I can reward the player, cash. Until I can learn how to save tools.
script.Parent.Text = "Code redeemed successfully!"
script.Parent.Parent.CodeHandler.Text = "" -- Removes the text in our code handler textbox
wait(2)
script.Parent.Text = "Redeem Code"
else
script.Parent.Text = "Code already redeemed!"
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 -- Your second code. So if our textbox matches the code in our dictionary...
if not codes:FindFirstChild("Code2") then -- This one here
RE:FireServer(3000, "Code2") -- The string must be the same as in the top. For now I can reward the player, cash. Until I can learn how to save tools.
script.Parent.Text = "Code redeemed successfully!"
script.Parent.Parent.CodeHandler.Text = ""
wait(2)
script.Parent.Text = "Redeem Code"
else
script.Parent.Text = "Code already redeemed!"
wait(2)
script.Parent.Text = "Redeem Code"
end
else
script.Parent.Text = "Code invalid!"
script.Parent.Parent.CodeHandler.Text = ""
wait(2)
script.Parent.Text = "Redeem Code"
end
end)
and the elseif is blue
but i dont want my code have a expiration date
Help


