Thank you. The code you provided worked
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menushop <- null;
class Shop {
a = null;
b = null;
constructor(a,b){
}
}
Global<-{
CreateObjList=[],
DeleteObjList=[]
}
CreateObjectEx<-CreateObject;
function CreateObject(model,world,pos,alpha)
{
local obj=CreateObjectEx(model,world,pos,alpha);
obj.TrackingShots=true;
obj.TrackingBumps=true;
Global.CreateObjList.append(obj.ID);
return obj;
}
function CObject::DeleteEx()
{
::Global.DeleteObjList.append([this.Model,this.Pos,this.Alpha,this.Rotation]);
this.Delete();
}
if(cmd=="undoobj")
{
if(Global.Map!=null)
{
if(Global.CreateObjList.len()>0)
{
while(true)
{
if(Global.CreateObjList.len()==0) break;
local obj=FindObject(Global.CreateObjList[Global.CreateObjList.len()-1]);
if(obj)
{
obj.DeleteEx();
Global.CreateObjList.remove(Global.CreateObjList.len()-1);
break;
}
else Global.CreateObjList.remove(Global.CreateObjList.len()-1);
}
}
else MessagePlayer("[#FF0000]There's no object left to undo.",player);
}
else MessagePlayer("[#FF0000]You first need to load a map.",player);
}
if(cmd=="redoobj")
{
if(Global.Map!=null)
{
if(Global.DeleteObjList.len()>0)
{
while(true)
{
if(Global.DeleteObjList.len()==0) break;
local arr=Global.DeleteObjList[Global.DeleteObjList.len()-1];
local obj=CreateObject(arr[0],player.World,arr[1],arr[2]).RotateTo(arr[3],0);
Global.DeleteObjList.remove(Global.DeleteObjList.len()-1);
break;
}
}
else MessagePlayer("[#FF0000]There's no object left to redo.",player);
}
else MessagePlayer("[#FF0000]You first need to load a map.",player);
}
class PlayerClass
{
constructor(id)
{
DefaultName=::FindPlayer(id).Name;
splayer=::FindPlayer(id);
}
DefaultName=null;
splayer=null;
DiePos=null;
Vehlist=[];
PickPickupID=null;
NearObjPos=null;
AddObjName=null;
AutoAngle=false;
CreateMode="Cross";
IsFirstSpawn=false;
EditObj=null;
AutoCreateSave=false;
}
function onScriptLoad()
{
state<-array(101,null);
}
function onPlayerJoin(player)
{
state[player.ID]=PlayerClass(player.ID);
}
function onPlayerPart(player,reason)
{
state[player.ID]=null;
}
if(cmd=="getglobal")
{
MessagePlayer("[#00FF00]Your Global: ",player);
foreach(i,j in state[player.ID])
{
MessagePlayer("[#00FF00]"+i+" = "+j,player);
}
}
AN ERROR HAS OCCURED [_nexti failed]
CALLSTACK
*FUNCTION [onPlayerCommand()] store/main.nut line [1173]
LOCALS
[j] NULL
[i] NULL
[text] NULL
[cmd] "getglobal"
[player] INSTANCE
[this] TABLE