Reference/Troubleshooting

SymptomLikely cause
My function never runsThe name is not exactly the event name (events are case sensitive: onPlayerSpawn), the file is missing from Script.xml, or the script folder is not in content.xml. Check the server console for a compile error.
Property read returns nullMisspelled property, or the entity no longer exists. Properties are case sensitive (Pos, not pos).
Setting a vector field does nothingplayer.Pos.x = 1 changes a temporary copy. Read the vector into a local, change it and assign it back.
CallServerFunc does nothingThe server did not call RegisterRemoteFunc("name"), or the function is not global, or it is not connected yet.
CallClientFunc does nothingThe function is not global in a client script, or the script has not finished downloading (wait for the player to join).
GUI is not visibleThe element was not added with AddGUILayer, a window's child was not attached with AddChild, or Visible is false.
Buttons cannot be clickedCall ShowMouseCursor(true) while the menu is open.
Players walk around behind my menuCall ToggleCameraMovement(false) while it is open and true when closing.
Timer not firingThe callback is a local function, or its name is wrong. Timers look up a global function by name.
NPC will not shootIt has no ammo: use npc.SetWeapon(id, ammo) and OBJ_ATTACK_PLAYER.
Sounds only play on the server PCServer FindSound plays on the server machine. Use <sound> in Script.xml and the client FindSound.
Categories: Troubleshooting and good habits