Trash scripter :/
if game.StarterGui.SpellWord.TextBox.Text == "Car" then print("Car was spelt") end
local Box = game.StarterGui.SpellWord.TextBox Box.Changed:Connect(function(c) if c == "Text" then print(Box.Text.." was spelt") end end)
i didint test this out but it should work. The error with your one sheepposu said is the script only checks once and never again but with the .Changed
event you can check if it spells something once it changes.
Basically, StarterGui is where the place to put ScreenGui at, they replicate to the user's PlayerGui, instead put a LocalScript inside the ScreenGui. Changing something to a ScreenGui in StarterGui will not affect the user's PlayerGui. Note: Please if you didn't understand, put the LocalScript inside the TextBox.
script.Parent.Changed:Connect(function() --TextBox event begins if script.Parent.Text == "Car" then --if Car was spelt in the TextBox, then do print("Car was spelt!") --success! end end)
Perfect! Changed can also be used when a property of an object is changed. Only Instance who have the Changed event can be used. Example is when Humanoid is damaged. It prints "Damaged!", but this time the event is called "HealthChanged". Put this code in a LocalScript in StarterGear to do so.
local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait() player.Character:WaitForChild("Humanoid").HealthChanged:Connect(function() print(player.Character:WaitForChild("Humanoid").Health.." is the current health of the user. DAMAGED!") end)
Rather than using loops, because loops can lag your game when printing so much in the client or server.
Here is a script that will make it confirm and print ¨Car was spelt¨ when key ¨;¨ is clicked, you would just have to get the keycode for enter if you wanted that. Put this LocalScript inside ¨SpellWord¨.
UserInput = game:GetService(¨UserInputService¨) AnswerBox = game.StarterGui.SpellWord[TextBox.Text] UserInput.InputBegan:Connect(function(Confirm) if input.KeyCode == Enum.KeyCode.Semicolon and game. print(¨Car was spelt¨!) end end)
IF- It does not work, let me know! Haven´t scripted for almost a year!
This should work. I haven’t tested it, but it basically constantly checks to see if the text is car.
while true do if game.StarterGui.SpellWord.TextBox.Text == "Car" then print("Car was spelt") end end