I am currently trying to make a notebook style system that kills a player if their name is typed into the notebook line (textbox) and then the available line moves down to the next line continuously until they run out of room and have to switch the page for a new set of available lines they can use.
I already have a textbox for every line. So, I really don’t want to have to resort to placing a local script in every notebook line (textbox) for obvious reasons.
This is my current code and it is not working. How would I switch to the next line in the notebook effciently
local UIS = game:GetService("UserInputService")
local lineNum = 1
local currentLine = script.Parent:FindFirstChild("Line"..lineNum)
UIS.InputBegan:Connect(function(input,GPE)
if input.KeyCode == Enum.KeyCode.Return then
lineNum = lineNum + 1
currentLine.PlaceholderText = "Write the person's name here..."
currentLine.TextEditable = false
local h = game.Workspace:FindFirstChild(currentLine.Text).Humanoid
if h then
script.KillPlayer:FireServer(h)
currentLine.TextColor3 = Color3.new(170,0,0)
wait(.5)
currentLine.TextColor3 = Color3.new(0,0,0)
else print("Character not found.")
end
end
end)