hi everyone i am new to gamedev but not new to coding
i had a question
is this the right code for a text rpg game in lua?
i got to this code so far
local Fish = Instance.new("IntValue")
local wood = Instance.new("IntValue")
wood.Value = 0
fish.Value = 0
io.write("you are trappedin the woods by yourself, alone")
io.write(", what should i do")
response = io.read()
if response == "Get wood" then
wood.Value = wood.Value + 1
print("the mission was a success")
else
print("you get wounded and need some bandages")
wood.Value = wood.Value - 1
end
if response == "Hunt for Fish" then
fish.Value = fish.Value + 1
print("the mission was a success")
else
print("The fish got away, will get them some other day")
end
end
io.write("now what should i do")
local Hut = Instance.new("IntValue")
Hut.Value = 0
if response == "Get wood" then
wood.Value = wood.Value + 1
print("the mission was a success")
else
print("you get wounded and need some bandages")
wood.Value = wood.Value - 1
end
if response == "Hunt for Fish" then
fish.Value = fish.Value + 1
print("the mission was a success")
else
print("The fish got away, will get them some other day")
end
if response == "Build a Hut " then
Hut.Value = Hut.Value + 1
print("The build was a success")
else
print("the build collapsed")
Hut.Value = Hut.Value - 1
end
end
io.write("Now that we have a shelter we can start exploring")
io.write("now what should i do?")
local trap = Instance.new("IntValue")
local toolset = Instance.new("IntValue")
trap.Value = 0
toolset.Value = 0
if response == "Get wood" then
wood.Value = wood.Value + 1
print("the mission was a success")
else
print("you get wounded and need some bandages")
wood.Value = wood.Value - 1
end
if response == "Hunt for Fish" then
fish.Value = fish.Value + 1
print("the mission was a success")
else
print("The fish got away, will get them some other day")
end
if response == "Build a Hut " then
Hut.Value = Hut.Value + 1
print("The build was a success")
else
print("the build collapsed")
Hut.Value = Hut.Value - 1
end
if response == "Build a Trap" then
Trap.Value = Trap.Value + 1
print("The build was a success")
else
print("the build collapsed")
Trap.Value = Trap.Value - 1
end
if response == "Forge a Tool set" then
toolset.Value = toolset.Value + 1
print("The Forging was a success")
else
print("the Forging didn't work correctly")
end
end
io.write("now what should i do?")
if response == "Get wood" then
wood.Value = wood.Value + 1
print("the mission was a success")
else
print("you get wounded and need some bandages")
wood.Value = wood.Value - 1
end
if response == "Hunt for Fish" then
fish.Value = fish.Value + 1
print("the mission was a success")
else
print("The fish got away, will get them some other day")
end
if response == "Build a Hut " then
Hut.Value = Hut.Value + 1
print("The build was a success")
else
print("the build collapsed")
Hut.Value = Hut.Value - 1
end
if response == "Build a Trap" then
Trap.Value = Trap.Value + 1
print("The build was a success")
else
print("the build collapsed")
Trap.Value = Trap.Value - 1
end
if response == "Forge a Tool set" then
toolset.Value = toolset.Value + 1
print("The Forging was a success")
else
print("the Forging didn't work correctly")
end
if response == "Check Traps" then
Fish.Value = Fish.Value + 5
print("the where caught")
else
print("The trap collapsed")
Fish.Value = Fish.Value - 3
end
end