script.Parent.Send.MouseButton1Click:connect(function() --Click
if script.Parent.PlayerName.Text[game.Players] then --If text = a player
if game.Players[script.Parent.PlayerName.Text].Backpack:FindFirstChild("Ticket") == nil then --if the player hasn't got the tool already
if script.Parent.PlayerClass.Text == "Eco" then --If the 2nd textBox's text is Eco, then
local clone = game.ReplicatedStorage.Ticket:Clone()
clone.Parent = game.Players[script.Parent.PlayerName.Text].Backpack --Clone
clone.Handle.BrickColor = BrickColor.new("Deep blue") --Change the tool's color
script.Parent.Send.Visible = false --Disable the button
wait(10)
script.Parent.Send.Visible = true --Enable the button
elseif script.Parent.PlayerClass.Text == "Pro" then --If the 2nd textBox's text is Pro, then
local clone = game.ReplicatedStorage.Ticket:Clone()
clone.Parent = game.Players[script.Parent.PlayerName.Text].Backpack
clone.Handle.BrickColor = BrickColor.new("Deep orange")
script.Parent.Send.Visible = false
wait(10)
script.Parent.Send.Visible = true
end
end
end
end)
There aren't any errors, and I do meet all the conditions. Yes, I did write this code. I'm just adding those comments as it does get a little confusing.
