Answer:
"Be careful, because the floor is wet," he warned.
Step-by-step explanation:
There is a continued sentence after the dialogue which is why there is a comma there. If there was no continued sentence after the dialogue, it would be a period following the dialogue.
Example: "Be careful, because the floor is wet."