• How can I store a variable on a player?
    2 replies, posted
[CODE]AddCSLuaFile( "cl_init.lua" ) -- Make sure clientside AddCSLuaFile( "shared.lua" ) -- and shared scripts are sent. include('shared.lua') function ENT:Initialize() self:SetModel( "models/entities/syringe_out.mdl" ) self:PhysicsInit( SOLID_VPHYSICS ) -- Make us work with physics, self:SetMoveType( MOVETYPE_VPHYSICS ) -- after all, gmod is a physics self:SetSolid( SOLID_VPHYSICS ) -- Toolbox local phys = self:GetPhysicsObject() if (phys:IsValid()) then phys:Wake() end end function ENT:Use( activator, caller ) local ply = activator if(!ply:IsPlayer()) then return else ply:Give("weapon_dc_speedster_v9") ply:SelectWeapon("weapon_dc_speedster_v9") self:Remove() end end function ENT:Think() end [/CODE] I want to make it so after 4 times a person uses the entity they will die. I would also like the amount of uses to reset to 0 after somebody dies. (Without using global variables)
[lua]ply.variable = value[/lua]
[QUOTE=man with hat;50012938][lua]ply.variable = value[/lua][/QUOTE] Ok thanks
Sorry, you need to Log In to post a reply to this thread.