Garry's Mod

Garry's Mod

Stryker's StarWars RP Information Panels
 This topic has been pinned, so it's probably important
Stryker  [developer] 25 Nov, 2019 @ 5:53am
Want your panel to flip back to first page when it hits the last page?
inside of init.lua
replace the ENT:Use function with this on the panels you want to flip back to the beginning when you hit the last page.
Or just take 5 lines I edited/added and replace it on your panels :)
function ENT:Use(caller) local trace = caller:GetEyeTrace() if not trace.Entity == self then return end local cursor = self:WorldToLocal(trace.HitPos) * Vector(10, 10, 10) if math.inrange(cursor.y, -size - 64 - 64, -size) and math.inrange(cursor.x, -size - 64 - 64, -size) then if self:GetPage() == self:GetMax() then self:SetPage(0) self:EmitSound("buttons/blip1.wav") elseif self:GetPage() >= self:GetMax() then return end self:SetPage(self:GetPage() + 1) self:EmitSound("buttons/blip1.wav") end if math.inrange(cursor.y, size , size + 64 + 64) and math.inrange(cursor.x, -size - 64 - 64, -size) then if self:GetPage() <= 1 then return end self:SetPage(self:GetPage() - 1) self:EmitSound("buttons/blip1.wav") end end
Last edited by Stryker; 25 Nov, 2019 @ 5:57am
< >
Showing 1-2 of 2 comments
s8n 25 Nov, 2019 @ 5:54am 
HEHE
Ravothan 10 Aug, 2022 @ 5:52pm 
what all do I copy cause im so confused
< >
Showing 1-2 of 2 comments
Per page: 1530 50