will_b_gaming Posted March 8, 2025 Share Posted March 8, 2025 I have a serverside mod that makes a player go AFK when they hit T. It works fine, but I'd like to move the activation from pressing T to pressing a button on the esc menu. How can I add a button to the esc menu and assign it a function? Link to comment https://forums.kleientertainment.com/forums/topic/164744-how-do-you-add-a-button-to-the-esc-menu/ Share on other sites More sharing options...
oregu Posted March 10, 2025 Share Posted March 10, 2025 (edited) Spoiler AddClassPostConstruct("screens/redux/pausescreen", function(self) self.menu:SetScale(.9) self.menu:SetPosition(self.menu:GetPosition() + GLOBAL.Vector3(0,8,0)) -- move up 8 units tried local bw, bh = self.menu.items[1]:GetSize() but didnt work self.menu:AddItem("example", function() return -- Whatever you want ur button to do end) for _,v in pairs(self.menu.items) do v:SetScale(.7) end end) You're going to have to use EditItem if you want to swap the position of menu items, I think. EditItem(num, text, text_size, cb) cb is the function, num is the index Edited March 10, 2025 by oregu Link to comment https://forums.kleientertainment.com/forums/topic/164744-how-do-you-add-a-button-to-the-esc-menu/#findComment-1805822 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now