I’m trying to get a sort of anti-cheat working on pointshop for something im working on and I have the code down but the problem is the function isnt repeating itself after being called once. It works the first time but not after that. This is what I have so far.
if not PS.ShopMenu then --if the pointshop is closed then open it when shop_point is called
PS.ShopMenu = vgui.Create(‘DPointShopMenu’)
net.Start( “AntiCheat” ) --send this message to the server when the pointshop is opened
if PS.ShopMenu:IsVisible() then --if the shop is open then close it and remove the anticheat timer PS.ShopMenu:Hide() gui.EnableScreenClicker(false) net.Start( "TimerDestroy" ) net.SendToServer() else PS.ShopMenu:Show() gui.EnableScreenClicker(true) end
net.Receive( “CloseMenu”, function( length, ply
)LocalPlayer():ConCommand( “shop_point” ) --closes the shop menu and gives the expired session message.
LocalPlayer():PrintMessage( HUD_PRINTTALK, “Your POINTSHOP session has expired due to an anti-cheat measure.” )
[LUA]net.Receive( “AntiCheat”, function(len, ply)
timer.Create(“point”, 10, 1, function()
if !IsValid(ply) then return end --receive the message and create the anticheat timer and send the message back.
net.Start( “CloseMenu” )
net.Send( ply )
net.Receive( “TimerDestroy”, function(len, ply) --destroys the anticheat timer.
timer.Destroy( “point” )
I commented most lines so you can see my thought process. The problem isnt that the code doesnt work, because it does, but that the code only runs when run right when the server starts. After that, it doesnt work again and I have to restart the server. Any help would be greatly appreciated.