Jump to content

Recommended Posts

local function isPlayerAdmin(player)

for k, v in pairs(GLOBAL.TheNet:GetClientTable()) do

if v.userid == player.userid then

return v.admin

end

end

end

local adminonly = {

wilson = true,

}

AddPlayerPostInit(function(inst)

if GLOBAL.TheWorld.ismastersim then

inst:DoTaskInTime(0, function()

if adminonly[inst.prefab] and not isPlayerAdmin(inst) then

inst:DoTaskInTime(1, function() inst.components.talker:Say("Picked admin only character.") end)

inst:DoTaskInTime(3, function() inst.components.talker:Say("Despawning...") end)

inst:DoTaskInTime(5, function() GLOBAL.c_despawn(inst) end)

end

end)

end

end)

local function isPlayerAdmin(player)    for k, v in pairs(GLOBAL.TheNet:GetClientTable()) do        if v.userid == player.userid then			return v.admin        end    endendlocal adminonly = {	wilson = true,}AddPlayerPostInit(function(inst)	if GLOBAL.TheWorld.ismastersim then		inst:DoTaskInTime(0, function()			if adminonly[inst.prefab] and not isPlayerAdmin(inst) then				inst:DoTaskInTime(1, function() inst.components.talker:Say("Picked admin only character.") end)				inst:DoTaskInTime(3, function() inst.components.talker:Say("Despawning...") end)				inst:DoTaskInTime(5, function() GLOBAL.c_despawn(inst) end)			end		end)	endend)

 

Oh my goodness!
This is really great
I super like him
 
You're a great man!
I'm very much obliged to you !!

Incidentally.
Do you have plans to make a period of time will remove unnecessary objects within the game instructions or modules it?
 
Because my server because too many things seem to lead to Lag
I checked my system performance, found that he often would go to 100% CPU
It really is a bad thing.
 
Above, thank you very much provides syntax
local function isPlayerAdmin(player)    for k, v in pairs(GLOBAL.TheNet:GetClientTable()) do        if v.userid == player.userid then			return v.admin        end    endendlocal adminonly = {	wilson = true,}AddPlayerPostInit(function(inst)	if GLOBAL.TheWorld.ismastersim then		inst:DoTaskInTime(0, function()			if adminonly[inst.prefab] and not isPlayerAdmin(inst) then				inst:DoTaskInTime(1, function() inst.components.talker:Say("Picked admin only character.") end)				inst:DoTaskInTime(3, function() inst.components.talker:Say("Despawning...") end)				inst:DoTaskInTime(5, function() GLOBAL.c_despawn(inst) end)			end		end)	endend)

 

Sorry, I would like to ask.
If you specify a particular User ID selection character
There are viable grammar?
 
Should I use
if (player.userid == KU_V5rTTIug) then
This syntax it?
Do you have plans to make a period of time will remove unnecessary objects within the game instructions or modules it?

 

I don't know what an unneccesary object is for you.

Unnecessary server strain is something for Klei to fix, many servers that survive for a year (72 days) have this problem.

 

If you think it's due to the stuff other people drop, then you can use this

AddComponentPostInit("inventoryitem", function(self)	local function StopDecay(inst, owner)		if inst.decayfn then			inst.decayfn:Cancel()			inst.decayfn = nil		end	end	local function StartDecay(inst)		StopDecay(inst)		inst.decayfn = inst:DoTaskInTime(480, function()			if inst:HasTag("INLIMBO") or inst.components.inventoryitem.owner then				return			end			inst:Remove()		end)	end	self.inst:ListenForEvent("onputininventory", StopDecay)	self.inst:ListenForEvent("ondropped", StartDecay)end)

so stuff that gets dropped on the floor will disappear after a day.

 

But I can't pinpoint with certainty what causes lag and performance issues.

 

If you specify a particular User ID selection character There are viable grammar? Should I use if (player.userid == KU_V5rTTIug) then This syntax it?
local function isPlayerMe(player)    return player.userid == "KU_V5rTTIug"end local meonly = {    wilson = true,} AddPlayerPostInit(function(inst)    if GLOBAL.TheWorld.ismastersim then        inst:DoTaskInTime(0, function()            if meonly[inst.prefab] and not isPlayerMe(inst) then                inst:DoTaskInTime(1, function() inst.components.talker:Say("Picked special character.") end)                inst:DoTaskInTime(3, function() inst.components.talker:Say("Despawning...") end)                inst:DoTaskInTime(5, function() GLOBAL.c_despawn(inst) end)            end        end)    endend)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...