What's wrong with my script? Only the first print statement is processed.
function onTouched(hit) if script.CoolDown.Value == false then script.CoolDown.Value = true print("1") if hit.Name == "Engine" then print("2") if workspace.TrashcanLocation.Value == 0 then print("3") workspace.TrashcanLocation.Value = 1 print("4") end end wait(1) script.CoolDown.Value = false end end script.Parent.Touched:connect(onTouched)
This server script is inside of a trigger. When a part named "Engine" touches the trigger, it changes a value to 1 if it was previously 0.