Skip to content
Course briefing · 20 min

Read and change game state

Change player properties and observe the result in a test world.

1

An API connects your code to the world

Game.Player.Character.Health is a player-character property. Game.Player.WantedLevel is a player property. Assigning a number with = requests a state change. In this lab the health range is simplified to 0–200; the simulator starts at 100 with a wanted level of 2.

2

Make the intent readable

You can assign a literal or a declared int variable. Set health to 200, wanted level to 0, then display Ready for patrol. The preview should reflect your assignments, not just print a success message.

3

Separate learning from a real game

This lab models a small set of Script Hook V .NET-style properties. It does not model armor, engine-specific health details, missions, or multiplayer. Test real behavior with the matching runtime documentation and a clean Story Mode baseline.

Script Hook V .NET: API source

Explore as a guest. Your current lab resumes in this browser session. Sign in before learning to save course completions to your account.

Sign in to save progress →