-- Hard Spelling Bee GUI Game local hardWords = { "lianfairpwllgwyngyllhoherychwyrndrobwllllantsiliogogogoch", "bread", "duck", "acquiesce","chargoggagoggmanchauggauggagoggchaubunagungamaugg", "mnemonic", "synecdoche", "chiaroscurist", "floccinaucinihilipilification", "antidisestablishmentarianism", "otorhinolaryngologist", "xylophonist", "quizzaciously", "sesquipedalian", "pseudopseudohypoparathyroidism", "patioliryagominitylisipanittiopalemicanisioparitmanistlogiaphobianit", "zeugma", "phosphorescent", "juxtaposition", "dichotomy", "onomatopoeia", "psilicaniopatinevlisinity", "pneumoltraultramicroscopssilionivolcanoconiosis", "hippopotomonstroesquipedeliophobia" } local gui = Instance.new("ScreenGui") gui.Name = "HardSpellingBeeGui" gui.ResetOnSpawn = false local frame = Instance.new("Frame") frame.Size = UDim2.new(0, 400, 0, 250) frame.Position = UDim2.new(0.5, -200, 0.5, -125) frame.BackgroundColor3 = Color3.fromRGB(245, 245, 255) frame.BorderSizePixel = 2 frame.Parent = gui local title = Instance.new("TextLabel") title.Size = UDim2.new(1, 0, 0, 40) title.Position = UDim2.new(0, 0, 0, 0) title.BackgroundTransparency = 1 title.Text = "Hard Spelling Bee" title.Font = Enum.Font.SourceSansBold title.TextSize = 32 title.TextColor3 = Color3.fromRGB(60, 60, 120) title.Parent = frame local prompt = Instance.new("TextLabel") prompt.Size = UDim2.new(1, -20, 0, 30) prompt.Position = UDim2.new(0, 10, 0, 50) prompt.BackgroundTransparency = 1 prompt.Text = "Spell this word:" prompt.Font = Enum.Font.SourceSans prompt.TextSize = 22 prompt.TextColor3 = Color3.fromRGB(40, 40, 80) prompt.TextXAlignment = Enum.TextXAlignment.Left prompt.Parent = frame local wordLabel = Instance.new("TextLabel") wordLabel.Size = UDim2.new(1, -20, 0, 30) wordLabel.Position = UDim2.new(0, 10, 0, 80) wordLabel.BackgroundTransparency = 1 wordLabel.Text = "" wordLabel.Font = Enum.Font.SourceSansItalic wordLabel.TextSize = 24 wordLabel.TextColor3 = Color3.fromRGB(80, 0, 0) wordLabel.TextXAlignment = Enum.TextXAlignment.Left wordLabel.Parent = frame local inputBox = Instance.new("TextBox") inputBox.Size = UDim2.new(1, -20, 0, 36) inputBox.Position = UDim2.new(0, 10, 0, 120) inputBox.PlaceholderText = "Type your spelling here" inputBox.Font = Enum.Font.SourceSans inputBox.TextSize = 22 inputBox.Text = "" inputBox.TextColor3 = Color3.fromRGB(0, 0, 0) inputBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255) inputBox.ClearTextOnFocus = false inputBox.Parent = frame local submitBtn = Instance.new("TextButton") submitBtn.Size = UDim2.new(0, 120, 0, 36) submitBtn.Position = UDim2.new(0.5, -60, 0, 170) submitBtn.Text = "Submit" submitBtn.Font = Enum.Font.SourceSansBold submitBtn.TextSize = 22 submitBtn.BackgroundColor3 = Color3.fromRGB(120, 180, 255) submitBtn.TextColor3 = Color3.fromRGB(0, 0, 0) submitBtn.Parent = frame local feedback = Instance.new("TextLabel") feedback.Size = UDim2.new(1, -20, 0, 28) feedback.Position = UDim2.new(0, 10, 0, 210) feedback.BackgroundTransparency = 1 feedback.Text = "" feedback.Font = Enum.Font.SourceSansItalic feedback.TextSize = 20 feedback.TextColor3 = Color3.fromRGB(0, 120, 0) feedback.Parent = frame local scoreLabel = Instance.new("TextLabel") scoreLabel.Size = UDim2.new(0, 120, 0, 28) scoreLabel.Position = UDim2.new(1, -130, 0, 10) scoreLabel.BackgroundTransparency = 1 scoreLabel.Text = "Score: 0" scoreLabel.Font = Enum.Font.SourceSansBold scoreLabel.TextSize = 20 scoreLabel.TextColor3 = Color3.fromRGB(0, 80, 0) scoreLabel.TextXAlignment = Enum.TextXAlignment.Right scoreLabel.ZIndex = 2 scoreLabel.Parent = frame -- Add the X close button in the top-right corner of the GUI, above the score local closeButton = Instance.new("TextButton") closeButton.Name = "CloseButton" closeButton.Text = "X" closeButton.Size = UDim2.new(0, 32, 0, 32) closeButton.Position = UDim2.new(1, -40, 0, 0) -- Top-right corner, no overlap with score closeButton.BackgroundColor3 = Color3.fromRGB(220, 60, 60) closeButton.TextColor3 = Color3.fromRGB(255, 255, 255) closeButton.Font = Enum.Font.SourceSansBold closeButton.TextSize = 24 closeButton.BorderSizePixel = 0 closeButton.AutoButtonColor = true closeButton.ZIndex = 3 -- Ensure it's above the score label closeButton.Parent = frame closeButton.MouseButton1Click:Connect(function() gui.Enabled = false -- Hide the GUI -- Alternatively, use gui:Destroy() if you want to remove it completely end) gui.Parent = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui") local currentWordIndex = 1 local score = 0 -- WPM tracking variables local startTime = 0 local endTime = 0 local function shuffleWords(words) for i = #words, 2, -1 do local j = math.random(1, i) words[i], words[j] = words[j], words[i] end end shuffleWords(hardWords) local function setNextWord() -- Handle case where there are 0 words if #hardWords == 0 then wordLabel.Text = "" prompt.Text = "Game Over!" feedback.Text = "No words to spell.\nFinal Score: 0\nWPM: 0" submitBtn.Visible = false inputBox.Visible = false return end if currentWordIndex > #hardWords then wordLabel.Text = "" prompt.Text = "Game Over!" endTime = os.clock() local elapsedSeconds = endTime - startTime local elapsedMinutes = elapsedSeconds / 60 local wordsDone = #hardWords local wpm = 0 if elapsedMinutes > 0 then wpm = math.floor(wordsDone / elapsedMinutes + 0.5) end feedback.Text = "Final Score: " .. tostring(score) .. "/" .. tostring(#hardWords) .. "\nWPM: " .. tostring(wpm) submitBtn.Visible = false inputBox.Visible = false return end wordLabel.Text = hardWords[currentWordIndex] prompt.Text = "Spell this word:" inputBox.Text = "" feedback.Text = "" -- Start timer on first word if currentWordIndex == 1 then startTime = os.clock() end end submitBtn.MouseButton1Click:Connect(function() -- If there are no words, do nothing if #hardWords == 0 then return end local answer = inputBox.Text local correct = hardWords[currentWordIndex] local elapsedSeconds = os.clock() - startTime local elapsedMinutes = elapsedSeconds / 60 local wordsTyped = currentWordIndex -- words attempted so far local wpm = 0 if elapsedMinutes > 0 then wpm = math.floor(wordsTyped / elapsedMinutes + 0.5) end if string.lower(answer) == string.lower(correct) then feedback.Text = "Correct!\nWPM: " .. tostring(wpm) feedback.TextColor3 = Color3.fromRGB(0, 120, 0) score = score + 1 scoreLabel.Text = "Score: " .. tostring(score) else feedback.Text = "Incorrect! The correct spelling was: " .. correct .. "\nWPM: " .. tostring(wpm) feedback.TextColor3 = Color3.fromRGB(180, 0, 0) end currentWordIndex = currentWordIndex + 1 task.wait(1.2) setNextWord() end) setNextWord()