Hiding content from other users?

I am trying to setup my server to where if you type “!yesdl” it will make all the models that are invisible visible to them. I am having issues with making the code change the material back and forth with ease, as well as making the content in the point shop show up without needing to rejoin the server.

Here is my code I am using:



if file.Read("tps.txt") == "yes" then
else
	file.Write("tps.txt", "no")
end



------------------------------------------------------
/*the below code is not ready and was a experiment

	local mat, mat2, mat3
	mat = Material( "props/package/package.vtf" )
	mat2 = Material( "Models/effects/vol_light001" )
	mat3 = Material( "props/package/package.vtf" )

	
	
if file.Read("tpsk.txt") == "no" then
mat:SetTexture( "$basetexture", mat2:GetTexture( "$basetexture" ) )
end
*/

/*
	if file.Exists("tps.txt") then
	else
	file.Write("tps.txt", "no")
	end
	*/
--------------------------------------------------------



function yesdl(ply, text, public )
	if ( string.sub( text, 1, 6) == "!yesdl") then
	file.Write("tps.txt", "yes")
	print( file.Read("tps.txt") )
	
	end

end
hook.Add( "PlayerSay", "yesdl", yesdl )

function nodl(ply, text, public )
	if ( string.sub( text, 1, 5) == "!nodl") then
	file.Write("tps.txt", "no")
	print( file.Read("tps.txt") )
	end

end
hook.Add( "PlayerSay", "nodl", nodl )

Here is the lua code in the point shop I am trying to get working

I am basically sectioning off all of the code inside of a if statement for the point shop item I only want visible to the people who have it enabled.


if file.Read("tps.txt") == "no" then
else
----code for pointshop item goes here--------
end

I was thinking about doing user groups but it makes it more confusing that way and harder if some people did not want to see certain content.

I also wanted to know if I was doing the function right. I feel like it should be only server side stuff, but I am not sure if its actually being ran.

Why, what, oh my, why are you using file.Write and file.Read for this?

Pointshop has an OnEquip / OnHolster function, set a variable for the player and then in a draw hook or something check for the variable?

I am using it because I not only want to hide it in the point shop, but from their view while they are playing as well. Like if someone has it equipped, they should not be able to see it. The file.write stuff is to help it stay activated or deactivated when other players rejoin the server.

Is there a way where I can make it no draw only for like, certain people? Like if the txt value is no, then no draw on all of the selected props I have only on their screen.

Ok is there away to like, make only certain objects invisible for one persons screen. Like can I make it where it no draws on a certain material to something that would be invisible, but then how would I get the material back.

bump