Code: Select all
/c
script.on_event(defines.events.on_player_setup_blueprint, function(event)
local cs = game.players[event.player_index].cursor_stack
if cs.valid then
game.print(cs.name)
end
end)
Step 3: Enjoy your crash.
What I expect: If I check if something is valid then it should be safe to use immediately after if I don't modify anything. I don't expect a crash when I write valid code
