Author Topic: Nothing happens  (Read 1499 times)

0 Members and 1 Guest are viewing this topic.

Offline MR-93

  • Major(1)
  • Posts: 15
Nothing happens
« on: April 12, 2008, 07:20:20 pm »
When i say !stat, nothing happens...
Whats wrong?

Code: [Select]
function OnCommand(ID: Byte; Text: string): boolean;
begin
    if Text = '!stat' then begin
     SpawnObject(GetPlayerStat(1,'x'),GetPlayerStat(1,'y'),15);
    end;
    Result := false;
end;

i want this script spawns stat gun when i say !stat 
« Last Edit: April 12, 2008, 07:32:48 pm by MR-93 »

Offline TheToast

  • Major
  • *
  • Posts: 52
Re: Nothing happens
« Reply #1 on: April 12, 2008, 07:27:50 pm »
You should try OnPlayerSpeak instead of OnCommand.

Offline Boblekonvolutt

  • Soldier
  • **
  • Posts: 222
  • "YOU are a CAR."
Re: Nothing happens
« Reply #2 on: April 12, 2008, 10:10:06 pm »
(This belongs in Scripting Discussions and Help)

You should also put ID instead of 1 in the GetPlayerStat's, or it will always spawn at player 1 (and not the user).