I need help with system.prompt
I'm making a horror game, but I can't get the code to work. Can you help?
Here's the code:
if mouse.release then
randomriddle = random.nextInt(5)
if randomriddle == 1 then
answer = system.prompt("What loses its head every morning, but gets it back every night?", text)
if answer == "a pillow" then
food = 32
water = 32
else
system.say("WRONG. Hint: no caps or periods")
difficulty += 0.5
end
end
if randomriddle == 2 then
answer = system.prompt("If violence isn't the answer, why does nature follow the rule: Survival of The Fittest?", text)
if answer == "violence is the answer" then
food = 32
water = 32
else
system.say("WRONG. Hint: no caps or periods")
difficulty += 0.5
end
end
if randomriddle == 3 then
answer = system.prompt("What fears the dark?", text)
if answer == "dweller" or answer == "me" then
food = 32
water = 32
else
system.say("WRONG. Hint: no caps or periods")
difficulty += 0.5
end
end
if randomriddle == 4 then
answer = system.prompt("What fears the light?")
if answer == "dweller" or answer == "death" then
else
system.say("WRONG. Hint: no caps or periods")
difficulty += 0.5
end
end
end
Here's the project link:
https://microstudio.io/codecat1/sweetnightmares4/
Is anyone able to help?


