• Table within a table?
    23 replies, posted
Is it possible to make it so each entry in a table has it's own table? For instance, If I were to want a table of all the players, and each player would have their own table.....Like Each entry in the table is a player..... but within each player entry there's a spot for say HP, Money,DistanceFrmPly... How would I do this exactly... PlayerTable[Player3].HP, or PlayerTable[Player3].Money Basically storing variables within each table entry. I know it can be done cause I have seen it before but I can't exactly recall how to replicate it.
Yeah. Something like: [lua] PlayerTable = {} for k,v in pairs(player.getall()) do PlayerTable[v:UniqueID()] = {} PlayerTable[v:UniqueID()).Health = 100 end [/lua] Would work.
It's very possible. [lua]local tbl = { -- This is our main table ["juices"] = { -- This is the 'juices' table inside our main table "orange juice", "lemon juice", "apple juice" }, ["foods"] = { -- This is the 'foods' table inside our main table ["junk food"] = { -- This is the 'junk food' table inside our 'foods' table "pizza", "chips", "crisps" }, ["healthy stuff"] = { -- This is the 'healthy stuff' table inside our 'foods' table "carrots", "apples", "grapes" } } }; PrintTable(tbl); -- Print the table to our console[/lua] It could be easily adapted to do what you need. [lua]PlayerTable = {}; hook.Add("PlayerInitialSpawn", "Create an entry in the PlayerTable", function(ply) if(!PlayerTable[ply:SteamID()]) then PlayerTable[ply:SteamID()] = {}; -- If he doesn't have an entry in the table, let's create one PlayerTable[ply:SteamID()]["Money"] = 200; -- Give him 200 dollars PlayerTable[ply:SteamID()]["Props broken"] = 0; -- etc PlayerTable[ply:SteamID()]["Favourite food"] = "pizza"; end end); hook.Add("PropBreak", "Modify an entry in the PlayerTable", function(ply, prop) PlayerTable[ply:SteamID()]["Props broken"] = PlayerTable[ply:SteamID()]["Props broken"] + 1; -- Increase his 'props broken' count when he breaks a prop end);[/lua]
Or you could just create a table for each player instead of having a global table with players in. like this [lua] for k, v in pairs( player.GetAll() ) do v.InfoTable = {}; v.InfoTable.Health = 100; end; [/lua]
Do that ^
[QUOTE=Chewgum.;18402536]Or you could just create a table for each player instead of having a global table with players in. like this [lua] for k, v in pairs( player.GetAll() ) do v.InfoTable = {}; v.InfoTable.Health = 100; end; [/lua][/QUOTE] Or indeed, [lua]for _,ply in ipairs( player.GetAll() ) do v.Health = 100; end[/lua] Incidentally, when you are giving out examples to newbies, please use ipairs when you are addressing sequential integer index'd tables. It doesn't really matter if you want to be inefficient in your own code, but please don't promote terrible habits in others.
If I did this for my aimbot [quote] BoneLocation = {} function AddEntB(EntMdl,Head,Neck,Chest) BoneLocation[EntMdl] = { ["Head"] = Head, ["Neck"] = Neck, ["Chest"] = Chest } end AddEntB("zombie.mdl","ValveBiped.Bip01_Head1","ValveBiped.Bip01_Neck1","ValveBiped.Bip01_Chest1") [/quote] if I wanted to do something like this...then if the model of the entity the player is looking at is zombie.mdl, and aimatneck would be set to neck then it would get the model of the neck from BoneLocation[EntMdl].("Neck") Something along the lines of [quote] local Ent = (LocalPlayer():GetEyeTrace().Entity) local EntModel = Ent:GetModel() if AimAtHead then BoneName = BoneLocation[EntModel].("Head") return end else if AimAtNeck then BoneName = BoneLocation[EntModel].("Neck") return end else if AimAtChest then BoneName = BoneLocation[EntModel].("Chest") return end end [/quote] I figure this would work, then the rest of my aiming function for my aimbot would take the bone from the function and aim with it... Do you see anything wrong with my code there?
Didn't know about ipairs :P I'm a newbie too :P
Could you explain the differences between 'pairs' and 'ipairs' cuz i never really looked into that ;/
[QUOTE=Chewgum.;18402769]Could you explain the differences between 'pairs' and 'ipairs' cuz i never really looked into that ;/[/QUOTE] ipairs only works on sequential integer indexed tables, pairs works on anything else. So ipairs should be used until you know some of the indexes are not integers.
ipairs iterates all integer indexes from 1..#tbl (i.e. it stops at _most_ gaps but not all of them) pairs iterates everything (including 1.5, "hello", Entity(5), Vector(1,2,3) and so on) referring to keys here
all entity table returning functions such as player.GetAll, ents.FindInSphere etc return sequential integer indexed tables, as do tables created with {a,b,c}, such as myTable = {"a", "b", "apple"}. table.insert also creates such tables, so [lua]myTable = {} table.insert(myTable,"a") table.insert(myTable,"b") table.insert(myTable,"apple")[/lua] would do the same thing. If you know you are going to deal with a table like this, you should always use ipairs, as ipairs is much faster than pairs, since it knows what all the keys are, while pairs has to look through the table to find every possible key.
Or you could use metafunctions and metatables, because that's what they're made for.
Ah very cool, and what are metatables flapjack? :P Always up for learning new stuff.
_G , _R , _E And so on [code]PrintTable(_G)[/code] Expect some lag. You can use this for pretty cool stuff. [code]_G[string.char(math.random(65 , 117)).."func"] = function(...) print(unpack(arg)) end[/code] Random function names. To be honest though, those are not metatables. Metatables are tables about data - for example players. Pretty similar to metafunctions.
Concretely in garrysmod every entity object shares the same MetaTable. The Entity metatable contains every method you can use on entities. Same goes for players and NPCs. What they allow you to do is to create methods shared by all of those objects (metamethods) or override the present ones. The advantage of methods is that they have an extra explicit argument "self". As an example these do exactly the same thing : [lua]function SetMoney(ply,money) ply.Money = money end SetMoney(Entity(1), 100)[/lua] [lua]local meta = getmetatable("Player") function meta:SetMoney(money) self.Money = money end Entity(1):SetMoney(100)[/lua] [lua]function _R["Player"]:SetMoney(money) --Note that _R["Player"] is the name of the Player metatable. <---Apparently not self.Money = money end Entity(1):SetMoney(100)[/lua] [url=http://wiki.garrysmod.com/?search=G.getmetatable][I]G.getmetatable[/I] [img]http://wiki.garrysmod.com/favicon.ico[/img][/url]
Actually, _R is the entity metatable. [code]21:37:09 > PrintTable(_R)... 1<TAB>=<TAB>Entity [300][env_soundscape] 2: <TAB><TAB>MetaID<TAB>=<TAB>32 <TAB><TAB>Finished<TAB>=<TAB>function: 02373E50 <TAB><TAB>GetBuffer<TAB>=<TAB>function: 02390B18 <TAB><TAB>DownloadSize<TAB>=<TAB>function: 0231ED58 <TAB><TAB>__gc<TAB>=<TAB>function: 0237F4C0 <TAB><TAB>Download<TAB>=<TAB>function: 02397940 <TAB><TAB>__index<TAB>=<TAB>table: 027BE9C0 <TAB><TAB>MetaName<TAB>=<TAB>HTTPConnection 4: <TAB><TAB>GetPathTimeToGoal<TAB>=<TAB>function: 02390380 <TAB><TAB>SetMovementSequence<TAB>=<TAB>function: 02332618 <TAB><TAB>LostEnemySound<TAB>=<TAB>function: 02392F78 <TAB><TAB>NavSetRandomGoal<TAB>=<TAB>function: 0237B908 <TAB><TAB>__tostring<TAB>=<TAB>function: 023948F8 <TAB><TAB>SetNPCState<TAB>=<TAB>function: 0238D8A8 <TAB><TAB>GetAimVector<TAB>=<TAB>function: 02362168 <TAB><TAB>SetExpression<TAB>=<TAB>function: 02360D88 <TAB><TAB>IsCurrentSchedule<TAB>=<TAB>function: 02363C98 <TAB><TAB>HasCondition<TAB>=<TAB>function: 0239A748 <TAB><TAB>TaskComplete<TAB>=<TAB>function: 023A2F08 <TAB><TAB>GetNPCState<TAB>=<TAB>function: 0237B9B0 <TAB><TAB>IdleSound<TAB>=<TAB>function: 0237EDD0 <TAB><TAB>SetTarget<TAB>=<TAB>function: 0239CC98 <TAB><TAB>GetExpression<TAB>=<TAB>function: 02331748 <TAB><TAB>ClearSchedule<TAB>=<TAB>function: 023211E8 <TAB><TAB>GetTarget<TAB>=<TAB>function: 0237F988 <TAB><TAB>UseActBusyBehavior<TAB>=<TAB>function: 0234BC50 <TAB><TAB>ConditionName<TAB>=<TAB>function: 023938D8 <TAB><TAB>ClearExpression<TAB>=<TAB>function: 02353390 <TAB><TAB>SetHullSizeNormal<TAB>=<TAB>function: 02390278 <TAB><TAB>GetHullType<TAB>=<TAB>function: 02371000 <TAB><TAB>SetLastPosition<TAB>=<TAB>function: 023937E8 <TAB><TAB>SetArrivalActivity<TAB>=<TAB>function: 0234BB48 <TAB><TAB>GetArrivalActivity<TAB>=<TAB>function: 0237BAA0 <TAB><TAB>GetEnemy<TAB>=<TAB>function: 0238B298 <TAB><TAB>PlayScene<TAB>=<TAB>function: 0230C380 <TAB><TAB>SetHullType<TAB>=<TAB>function: 0233D298 <TAB><TAB>CapabilitiesGet<TAB>=<TAB>function: 023A26C8 <TAB><TAB>SetArrivalDirection<TAB>=<TAB>function: 0238EEE0 <TAB><TAB>ExitScriptedSequence<TAB>=<TAB>function: 0234BBF0 <TAB><TAB>SetSchedule<TAB>=<TAB>function: 0234CFD0 <TAB><TAB>MetaName<TAB>=<TAB>NPC <TAB><TAB>AddRelationship<TAB>=<TAB>function: 023954E0 <TAB><TAB>GetActiveWeapon<TAB>=<TAB>function: 023A2548 <TAB><TAB>StartEngineTask<TAB>=<TAB>function: 023905C0 <TAB><TAB>IsNPC<TAB>=<TAB>function: 02380060 <TAB><TAB>UseAssaultBehavior<TAB>=<TAB>function: 02359318 <TAB><TAB>NavSetWanderGoal<TAB>=<TAB>function: 02375BA8 <TAB><TAB>SentenceStop<TAB>=<TAB>function: 02304AA8 <TAB><TAB>__newindex<TAB>=<TAB>function: 0233C6E0 <TAB><TAB>MaintainActivity<TAB>=<TAB>function: 0232EDA8 <TAB><TAB>TaskFail<TAB>=<TAB>function: 02377DE0 <TAB><TAB>AddEntityRelationship<TAB>=<TAB>function: 02311F60 <TAB><TAB>PlaySentence<TAB>=<TAB>function: 023295E8 <TAB><TAB>SetMaxRouteRebuildTime<TAB>=<TAB>function: 02307148 <TAB><TAB>CapabilitiesAdd<TAB>=<TAB>function: 02395840 <TAB><TAB>GetPathDistanceToGoal<TAB>=<TAB>function: 0231E7A0 <TAB><TAB>IsRunningBehavior<TAB>=<TAB>function: 0238A2D8 <TAB><TAB>GetArrivalSequence<TAB>=<TAB>function: 02336890 <TAB><TAB>MetaBaseClass: <TAB><TAB><TAB><TAB>SetMoveParent<TAB>=<TAB>function: 02389180 <TAB><TAB><TAB><TAB>SetLocalAngles<TAB>=<TAB>function: 02374E70 <TAB><TAB><TAB><TAB>GetModel<TAB>=<TAB>function: 0235E9E8 <TAB><TAB><TAB><TAB>SetSolidMask<TAB>=<TAB>function: 0230A868 <TAB><TAB><TAB><TAB>SetHealth<TAB>=<TAB>function: 0232FF78 <TAB><TAB><TAB><TAB>__tostring<TAB>=<TAB>function: 0239E4C8 <TAB><TAB><TAB><TAB>AddEffects<TAB>=<TAB>function: 0234D150 <TAB><TAB><TAB><TAB>GetMaxHealth<TAB>=<TAB>function: 02318080 <TAB><TAB><TAB><TAB>GetColor<TAB>=<TAB>function: 0239EC00 <TAB><TAB><TAB><TAB>GetMoveParent<TAB>=<TAB>function: 02361E98 <TAB><TAB><TAB><TAB>SkinCount<TAB>=<TAB>function: 0231DC78 <TAB><TAB><TAB><TAB>StopLoopingSound<TAB>=<TAB>function: 0230FA58 <TAB><TAB><TAB><TAB>SetBloodColor<TAB>=<TAB>function: 023A2008 <TAB><TAB><TAB><TAB>SetParentPhysNum<TAB>=<TAB>function: 0232F030 <TAB><TAB><TAB><TAB>SetPlaybackRate<TAB>=<TAB>function: 023A1810 <TAB><TAB><TAB><TAB>GetParent<TAB>=<TAB>function: 02395C48 <TAB><TAB><TAB><TAB>SetLocalVelocity<TAB>=<TAB>function: 0234DF18 <TAB><TAB><TAB><TAB>SetParent<TAB>=<TAB>function: 0238C300 <TAB><TAB><TAB><TAB>BoundingRadius<TAB>=<TAB>function: 02318AA0 <TAB><TAB><TAB><TAB>SetCollisionGroup<TAB>=<TAB>function: 0233DC70 <TAB><TAB><TAB><TAB>StopMotionController<TAB>=<TAB>function: 02394070 <TAB><TAB><TAB><TAB>SetRenderMode<TAB>=<TAB>function: 02333140 <TAB><TAB><TAB><TAB>GetPhysicsObject<TAB>=<TAB>function: 0236B630 <TAB><TAB><TAB><TAB>GetGroundEntity<TAB>=<TAB>function: 02311AC8 <TAB><TAB><TAB><TAB>LocalToWorldAngles<TAB>=<TAB>function: 02352718 <TAB><TAB><TAB><TAB>GetAngles<TAB>=<TAB>function: 0230FD70 <TAB><TAB><TAB><TAB>RestartGesture<TAB>=<TAB>function: 02374888 <TAB><TAB><TAB><TAB>SetNetworkedBool<TAB>=<TAB>function: 023941F0 <TAB><TAB><TAB><TAB>SetElasticity<TAB>=<TAB>function: 0239B270 <TAB><TAB><TAB><TAB>TranslatePhysBoneToBone<TAB>=<TAB>function: 0237C400 <TAB><TAB><TAB><TAB>SetShouldDrawInViewMode<TAB>=<TAB>function: 02392978 <TAB><TAB><TAB><TAB>Weapon_SetActivity<TAB>=<TAB>function: 02395030 <TAB><TAB><TAB><TAB>IsValid<TAB>=<TAB>function: 023A0268 <TAB><TAB><TAB><TAB>GetPhysicsObjectNum<TAB>=<TAB>function: 02318098 <TAB><TAB><TAB><TAB>FireBullets<TAB>=<TAB>function: 023A3A78 <TAB><TAB><TAB><TAB>PhysicsInit<TAB>=<TAB>function: 02336578 <TAB><TAB><TAB><TAB>MetaName<TAB>=<TAB>Entity <TAB><TAB><TAB><TAB>Weapon_TranslateActivity<TAB>=<TAB>function: 02309578 <TAB><TAB><TAB><TAB>WorldToLocalAngles<TAB>=<TAB>function: 02386DF8 <TAB><TAB><TAB><TAB>GetClass<TAB>=<TAB>function: 02367BF8 <TAB><TAB><TAB><TAB>SetColor<TAB>=<TAB>function: 023178D0 <TAB><TAB><TAB><TAB>CallOnRemove<TAB>=<TAB>function: 0236EA80 <TAB><TAB><TAB><TAB>SetNetworkedVarProxy<TAB>=<TAB>function: 02381050 <TAB><TAB><TAB><TAB>SetEyeTarget<TAB>=<TAB>function: 0237FAA8 <TAB><TAB><TAB><TAB>SetBodygroup<TAB>=<TAB>function: 02388DC0 <TAB><TAB><TAB><TAB>DrawShadow<TAB>=<TAB>function: 02387C38 <TAB><TAB><TAB><TAB>GetVar<TAB>=<TAB>function: 023817E8 <TAB><TAB><TAB><TAB>SetNetworkedVar<TAB>=<TAB>function: 0239D400 <TAB><TAB><TAB><TAB>GetNetworkedVar<TAB>=<TAB> 21:37:10 function: 02392648 <TAB><TAB><TAB><TAB>GetFlexNum<TAB>=<TAB>function: 023A14F8 <TAB><TAB><TAB><TAB>Respawn<TAB>=<TAB>function: 0237E680 <TAB><TAB><TAB><TAB>SequenceDuration<TAB>=<TAB>function: 0237AC18 <TAB><TAB><TAB><TAB>AlignAngles<TAB>=<TAB>function: 02396530 <TAB><TAB><TAB><TAB>SetVar<TAB>=<TAB>function: 02364250 <TAB><TAB><TAB><TAB>SetAttachment<TAB>=<TAB>function: 02356BB8 <TAB><TAB><TAB><TAB>RemoveCallOnRemove<TAB>=<TAB>function: 0238A6B0 <TAB><TAB><TAB><TAB>MuzzleFlash<TAB>=<TAB>function: 02393950 <TAB><TAB><TAB><TAB>IsWeapon<TAB>=<TAB>function: 02333980 <TAB><TAB><TAB><TAB>GetBoneMatrix<TAB>=<TAB>function: 02390098 <TAB><TAB><TAB><TAB>SetUnFreezable<TAB>=<TAB>function: 023A00B
That's pretty nice, mind being useful and providing the proper name so I can edit my post?
_R["Player"] There is also _G["Player"] though. [code]21:42:43 > PrintTable(_R["Player"])... GetScriptedVehicle<TAB>=<TAB>function: 02370880 GetViewOffsetDucked<TAB>=<TAB>function: 02745E00 __tostring<TAB>=<TAB>function: 0238CA08 GetAimVector<TAB>=<TAB>function: 02393D10 CrosshairEnable<TAB>=<TAB>function: 0238C048 EquipSuit<TAB>=<TAB>function: 02305528 GetEyeTraceNoCursor<TAB>=<TAB>function: 023878F0 ChatPrint<TAB>=<TAB>function: 02330CC8 DetonateTripmines<TAB>=<TAB>function: 02381B78 TraceHullAttack<TAB>=<TAB>function: 02395C78 ViewPunch<TAB>=<TAB>function: 023128F0 StripWeapons<TAB>=<TAB>function: 02317DB0 ShouldDropWeapon<TAB>=<TAB>function: 02308F00 GetAmmoCount<TAB>=<TAB>function: 0235F6C0 SendLua<TAB>=<TAB>function: 02310730 PacketLoss<TAB>=<TAB>function: 02312D10 Spectate<TAB>=<TAB>function: 023563D8 SetUserGroup<TAB>=<TAB>function: 02361CE8 DropWeapon<TAB>=<TAB>function: 02348560 Lock<TAB>=<TAB>function: 023500A8 GetInfo<TAB>=<TAB>function: 0235DA70 PrintMessage<TAB>=<TAB>function: 0234F448 SprintDisable<TAB>=<TAB>function: 0235F9D8 SetNoTarget<TAB>=<TAB>function: 023314F0 KeyPressed<TAB>=<TAB>function: 0238E850 MetaName<TAB>=<TAB>Player UniqueIDTable<TAB>=<TAB>function: 02387920 UniqueID<TAB>=<TAB>function: 023673D0 LegsGib<TAB>=<TAB>function: 0238DE18 GodDisable<TAB>=<TAB>function: 023941A8 IsSuperAdmin<TAB>=<TAB>function: 02362948 SelectWeapon<TAB>=<TAB>function: 0237DA08 SetCanZoom<TAB>=<TAB>function: 023383C0 MetaBaseClass: <TAB><TAB>SetMoveParent<TAB>=<TAB>function: 02389180 <TAB><TAB>SetLocalAngles<TAB>=<TAB>function: 02374E70 <TAB><TAB>GetModel<TAB>=<TAB>function: 0235E9E8 <TAB><TAB>SetSolidMask<TAB>=<TAB>function: 0230A868 <TAB><TAB>SetHealth<TAB>=<TAB>function: 0232FF78 <TAB><TAB>__tostring<TAB>=<TAB>function: 0239E4C8 <TAB><TAB>AddEffects<TAB>=<TAB>function: 0234D150 <TAB><TAB>GetMaxHealth<TAB>=<TAB>function: 02318080 <TAB><TAB>GetColor<TAB>=<TAB>function: 0239EC00 <TAB><TAB>GetMoveParent<TAB>=<TAB>function: 02361E98 <TAB><TAB>SkinCount<TAB>=<TAB>function: 0231DC78 <TAB><TAB>StopLoopingSound<TAB>=<TAB>function: 0230FA58 <TAB><TAB>SetBloodColor<TAB>=<TAB>function: 023A2008 <TAB><TAB>SetParentPhysNum<TAB>=<TAB>function: 0232F030 <TAB><TAB>SetPlaybackRate<TAB>=<TAB>function: 023A1810 <TAB><TAB>GetParent<TAB>=<TAB>function: 02395C48 <TAB><TAB>SetLocalVelocity<TAB>=<TAB>function: 0234DF18 <TAB><TAB>SetParent<TAB>=<TAB>function: 0238C300 <TAB><TAB>BoundingRadius<TAB>=<TAB>function: 02318AA0 <TAB><TAB>SetCollisionGroup<TAB>=<TAB>function: 0233DC70 <TAB><TAB>StopMotionController<TAB>=<TAB>function: 02394070 <TAB><TAB>SetRenderMode<TAB>=<TAB>function: 02333140 <TAB><TAB>GetPhysicsObject<TAB>=<TAB>function: 0236B630 <TAB><TAB>GetGroundEntity<TAB>=<TAB>function: 02311AC8 <TAB><TAB>LocalToWorldAngles<TAB>=<TAB>function: 02352718 <TAB><TAB>GetAngles<TAB>=<TAB>function: 0230FD70 <TAB><TAB>RestartGesture<TAB>=<TAB>function: 02374888 <TAB><TAB>SetNetworkedBool<TAB>=<TAB>function: 023941F0 <TAB><TAB>SetElasticity<TAB>=<TAB>function: 0239B270 <TAB><TAB>TranslatePhysBoneToBone<TAB>=<TAB>function: 0237C400 <TAB><TAB>SetShouldDrawInViewMode<TAB>=<TAB>function: 02392978 <TAB><TAB>Weapon_SetActivity<TAB>=<TAB>function: 02395030 <TAB><TAB>IsValid<TAB>=<TAB>function: 023A0268 <TAB><TAB>GetPhysicsObjectNum<TAB>=<TAB>function: 02318098 <TAB><TAB>FireBullets<TAB>=<TAB>function: 023A3A78 <TAB><TAB>PhysicsInit<TAB>=<TAB>function: 02336578 <TAB><TAB>MetaName<TAB>=<TAB>Entity <TAB><TAB>Weapon_TranslateActivity<TAB>=<TAB>function: 02309578 <TAB><TAB>WorldToLocalAngles<TAB>=<TAB>function: 02386DF8 <TAB><TAB>GetClass<TAB>=<TAB>function: 02367BF8 <TAB><TAB>SetColor<TAB>=<TAB>function: 023178D0 <TAB><TAB>CallOnRemove<TAB>=<TAB>function: 0236EA80 <TAB><TAB>SetNetworkedVarProxy<TAB>=<TAB>function: 02381050 <TAB><TAB>SetEyeTarget<TAB>=<TAB>function: 0237FAA8 <TAB><TAB>SetBodygroup<TAB>=<TAB>function: 02388DC0 <TAB><TAB>DrawShadow<TAB>=<TAB>function: 02387C38 <TAB><TAB>GetVar<TAB>=<TAB>function: 023817E8 <TAB><TAB>SetNetworkedVar<TAB>=<TAB>function: 0239D400 <TAB><TAB>GetNetworkedVar<TAB>=<TAB>function: 02392648 <TAB><TAB>GetFlexNum<TAB>=<TAB>function: 023A14F8 <TAB><TAB>Respawn<TAB>=<TAB>function: 0237E680 <TAB><TAB>SequenceDuration<TAB>=<TAB>function: 0237AC18 <TAB><TAB>AlignAngles<TAB>=<TAB>function: 02396530 <TAB><TAB>SetVar<TAB>=<TAB>function: 02364250 <TAB><TAB>SetAttachment<TAB>=<TAB>function: 02356BB8 <TAB><TAB>RemoveCallOnRemove<TAB>=<TAB>function: 0238A6B0 <TAB><TAB>MuzzleFlash<TAB>=<TAB>function: 02393950 <TAB><TAB>IsWeapon<TAB>=<TAB>function: 02333980 <TAB><TAB>GetBoneMatrix<TAB>=<TAB>function: 02390098 <TAB><TAB>SetUnFreezable<TAB>=<TAB>function: 023A00B8 <TAB><TAB>Health<TAB>=<TAB>function: 0231D4E0 <TAB><TAB>GetNetworkedString<TAB>=<TAB>function: 02363710 <TAB><TAB>PhysWake<TAB>=<TAB>function: 02309458 <TAB><TAB>WorldToLocal<TAB>=<TAB>function: 02353108 <TAB><TAB>IsConstrained<TAB>=<TAB>function: 02370550 <TAB><TAB>SetNWBool<TAB>=<TAB>function: 0237A300 <TAB><TAB>SetNWEntity<TAB>=<TAB>function: 0231E338 <TAB><TAB>GetRight<TAB>=<TAB>function: 02306530 <TAB><TAB>SetBoneMatrix<TAB>=<TAB>function: 02382310 <TAB><TAB>GetNetworkedVector<TAB>=<TAB>function: 0230ACB8 <TAB><TAB>GetPos<TAB>=<TAB>function: 0238ADD0 <TAB><TAB>GetBloodColor<TAB>=<TAB>function: 02307FE8 <TAB><TAB>__gc<TAB>=<TAB>function: 02316D18 <TAB><TAB>SetNWVector<TAB>=<TAB>function: 023A3988 <TAB><TAB>GetNWVector<TAB>=<TAB>function: 023A3C28 <TAB><TAB>Remove<TAB>=<TAB>function: 023697E8 <TAB><TAB>ResetSequence<TAB>=<TAB>function: 0232B280 <TAB><TAB>SetNetworkedInt<TAB>=<TAB>function: 02310A90 <TAB><TAB>IsEffectActive<TAB>=<TAB>function: 0239F620 <TAB><TAB>GetUnFreezable<TAB>=<TAB>function: 02389948 <TAB><TAB>__index<TAB>=<TAB>function: 0238AB18 <TAB><TAB> 21:42:44 PhysicsInitSphere<TAB>=<TAB>function: 0238B100 <TAB><TAB>SetNetworkedEntity<TAB>=<TAB>function: 0235C648 <TAB><TAB>IsOnGround<TAB>=<TAB>function: 02327C80 <TAB><TAB>OnGround<TAB>=<TAB>function: 02396230 <TAB><TAB>SetNetworkedAngle<TAB>=<TAB>function: 0234DB28 <TAB><TAB>SetNetworkedVector<TAB>=<TAB>function: 023A18B8 <TAB><TAB>GetLocalAngles<TAB>=<TAB>function: 0239FC80 <TAB><TAB>GetActivity<TAB>=<TAB>function: 0237AB58 <TAB><TAB>GetOwner<TAB>=<TAB>function: 0234FEC8 <TAB><TAB>SetNetworkedString<TAB>=<TAB>function: 02328F28 <TAB><TAB>EyeAngles<TAB>=<TAB>function: 02369770 <TAB><TAB>DispatchTraceAttack<TAB>=<TAB>function: 0234C9B8 <TAB><TAB>StopParticles<TAB>=<TAB>function: 02380558 <TAB><TAB>GetNWString<TAB>=<TAB>function: 0239E840 <TAB><TAB>GetNWEntity<TAB>=<TAB>function: 02376340 <TAB><TAB>WaterLevel<TAB>=<TAB>function: 023354B0 <TAB><TAB>GetNetworkedInt<TAB>=<TAB>function: 02355010 <TAB><TAB>Visible<TAB>=<TAB>function: 0236DB98 <TAB><TAB>GetNetworkedEntity<TAB>=<TAB>function: 022F6AE0 <TAB><TAB>GetNWBool<TAB>=<TAB>function: 0237B128 <TAB><TAB>SetCollisionBoundsWS<TAB>=<TAB>function:
[QUOTE=| FlapJack |;18407903]_R["Player"] There is also _G["Player"] though.[/QUOTE] Oh right.. since it is a table inside the entity metatable. :smile: _G["Player"] is most probably the player library?
Infact, yeah. It is. [code]PrintTable(_G["player"])[/code] [code]21:48:29 > PrintTable(_G["player"])... GetBots<TAB>=<TAB>function: 023266D8 GetByID<TAB>=<TAB>function: 0239FC08 GetByUniqueID<TAB>=<TAB>function: 02341E88 GetAll<TAB>=<TAB>function: 02383A50 GetHumans<TAB>=<TAB>function: 02349BC8[/code]
[QUOTE=| FlapJack |;18407992]I think so. For some reason, it returned a function when I tried to print it.[/QUOTE] Because it is a function. Player(userid)? And quoted from the FindMetaTable page on the wiki: [quote]If you make your own metatable and want it accessible by this function, put _R.NameHere = TableHere when you've finished defining it.[/quote]
Yo dawg, so I herd you like tables...
[QUOTE=Chrisaster;18408010]Because it is a function. Player(userid)?[/QUOTE] Was the difference between upper and lowercase. I knew it existed :P [code]21:52:02 > print(_G["Player"])... function: 02374B40 [/code] [code]21:52:23 > print(_G["player"])... table: 027A3CE0 [/code]
Sorry, you need to Log In to post a reply to this thread.