Agent Comfy wrote:
NotCoolDude wrote:
TheXnator wrote:
Bunnyslippers69 wrote:
TheXnator wrote:
NotCoolDude wrote:
TheXnator wrote:
DEADMONSTOR wrote:
TheXnator wrote:
.then(() => ssrpUpdate()).catch(function (err) {
console.log("wait for map");
})
function releaseUpdate(){
finishUpdate()
.then(() => releaseSummerUpdate()).catch(function (err) {
console.log("Something got in the 'way'.");
setTimeout(releaseUpdate, 1.728e+8);
})
}
function releaseUpdate(){
finishUpdate()
.then(() => releaseSummerUpdate()).catch(function (err) {
console.log("Map broke.");
.then(() => releaseSummerUpdate()).catch(function (err) {
console.log("Sick.");
.then(() => releaseSummerUpdate()).catch(function (err) {
console.log("Soon");
setTimeout(releaseUpdate, 1.728e+8);
})
})
}
Can you guys even actually code besides of making this jokes with creating functions and fake ETA of the update using logs? And massive numbers like 1.728*10^8
madePointshopUpdate = {}
madePointshopUpdate["TheXnator"] = true
madePointshopUpdate["DEADMONSTOR"] = true
gotCommunityDev["DEADMONSTOR"] = true
gotCommunityDev["TheXnator"] = false
doesCMDevJob["DEADMONSTOR"] = false
getsToldByCMDevToWork["TheXnator"] = true
function GetIRLVars
{
Local arr
Arr [0] = player.GetInfo()
Print ("I do not associate with. Skeleton warrior reeeeeeee"
}
while all of you nerds are at it can someone tell me whats wrong with this
function ENT:Initialize()
self:SetModel( "models/props_interiors/BathTub01a.mdl" )
self:PhysicsInit( SOLID_VPHYSICS )
self:SetMoveType( MOVETYPE_VPHYSICS )
self:SetSolid( SOLID_VPHYSICS )
local phys = self:GetPhysicsObject()
if (phys:IsValid()) then
phys:Wake()
local ExplodeTime = 5
self:SetPos( ENT.GetOwner.EyePos() + ( ENT.GetOwner.GetAimVector() * 16 ) )
self:SetAngles( ENT.GetOwner.EyeAngles() )
local velocity = ENT.GetOwner.GetAimVector()
velocity = velocity * 100
velocity = velocity + ( VectorRand() * 10 ) -- a random element
phys:ApplyForceCenter( velocity )
end
end
Im getting
[ERROR] addons/empgnade/lua/weapons/weapon_emp.lua:22: attempt to index global 'ent' (a nil value)
1. unknown - addons/empgnade/lua/weapons/weapon_emp.lua:22
when i fire the weapon
the entity spawns when i fire the weapon
function ENT:Initialize()
self:SetModel( "models/props_interiors/BathTub01a.mdl" )
self:PhysicsInit( SOLID_VPHYSICS )
self:SetMoveType( MOVETYPE_VPHYSICS )
self:SetSolid( SOLID_VPHYSICS )
local phys = self:GetPhysicsObject()
if (phys:IsValid()) then
phys:Wake()
local ExplodeTime = 5
self:SetPos( self:GetOwner:EyePos() + ( self:GetOwner:GetAimVector() * 16 ) )
self:SetAngles( self:GetOwner:EyeAngles() )
local velocity = self:GetOwner:GetAimVector()
velocity = velocity * 100
velocity = velocity + ( VectorRand() * 10 ) -- a random element
phys:ApplyForceCenter( velocity )
end
end
So your problem was the
part of the code
Basically there are a few things to consider. Anything that comes after the start of that function
function ENT:Initialize()
Is inside whats considered a scope, while your in that scope you have access to a special variable
self is the object noted before the semi colon in the function declaration. This is part of object orientated programming and I would recommend taking a read here to better understand this
www.lua.org/pil/16.html
Thats why you were getting a nil error because in that scope ENT didn't exist and you should have been accessing that stuff using self. The other important thing to consider is when your calling a function you need to do so with a semi-colon. A period indcates you are accessing a value in a table while a semicolon means you are calling a function in that table. Again I would check out lua.org if your having trouble because understanding the how lua functions at a base level is key to being able to enjoy coding lua. Also if that still doesn't work post the whole file.