All pastes #827404 Raw Edit

Unnamed

public text v1 · immutable
#827404 ·published 2007-12-21 19:12 UTC
rendered paste body
AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include("shared.lua")

function ENT:Initialize()
	self:SetTrigger(true)
end

function ENT:KeyValue(key, value)
	if(key == "id") then
		self.checkid = tonumber(value)
		print("Did checkpoint keyvalues: "..value)
	end
end 

function ENT:Touch(ent)

end

function ENT:StartTouch(ent)
	if ent:IsValid() and (ent:IsPlayer()) then
		local ply = ent
		local checknext = ply:GetNetworkedInt("checkpoint") + 1
		print(self.checkid)
		print(checknext)
		if self.checkid == checknext then
			print("3")
			ply:SetNetworkedInt("checkpoint", self.checkid)
		end		
	end
end

function ENT:EndTouch(ent)

end