this is a monitor thingy… but anyway I have fixed your code up
-- A ComputerCraft program for a match scoreboard (ex. Handball match), to keep track and show the crowd the result
-- Couldn't figure out how to use "print" instead of "write" cause it would have looked better...
-- You can freely modify this code as you wish :)/>/>
-- Author: BobbyB33
x1=0
x2=0
while true do
mon=peripheral.wrap("right")
mon.clear()
mon.setCursorPos(8,1)
mon.setTextScale(1.5)
mon.write("SuperForm "..x1)
mon.setCursorPos(8,5)
mon.write("Karprensi "..x2)
input=read()
if input=="h" then
x1=x1+1
elseif input=="a" then
x2=x2+1
if x2>=5 then
mon.clear()
mon.setCursorPos(8.4)
mon.write("Winner is Karprensi")
end
end
first of all x2=5 needed to be x2==5 (I do >= so it checks five and above) because it is the comparison operator x2=5 would set it to 5 but in this case it would error
then you have your If statement and elseifs wrong they need to be in the same block of code
--example that works
if a==1 then
--some stuff
elseif a==2 then
--other stuff
end
that checks the first statement then if its not it goes to the elseif this is the example that wont work
if a==1 then
--some stuff
end
elseif a==2 then
--stuff
end
so your elseif at the bottom would be in no code block a normal if statement would do because if its elseif it will only check after everything else has failed if that fails it goes to the else statement
one last point if you want to you can redirect to a monitor using term.redirect and use print etc. on the monitor :)/>