Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Replacing Alt and Shift keys:
- Alt key:
- Where you can find this:
- ui.lua
- Lines: 701, 1702 (before editing)
- local alt = LocalPlayer():KeyDown( IN_WALK )
- replace with:
- local alt = input.IsKeyDown(81)
- ------------------------------------
- Shift key
- Where you can find this:
- ui.lua
- Line: 1701 (before editing)
- prop_functions.lua
- Lines: 53, 91, 1113 (before editing)
- local shift = LocalPlayer():KeyDown( IN_SPEED )
- replace with:
- local alt = input.IsKeyDown(79)
- 2. Fixing a bug that occurs when you try to stack a prop over a limit, it breaks whole stacking function, justly the tool stacks over the limit, it doesn't have any limit.
- Function that checks if you can spawn entity (tweak it to the server needs, I tested it on Sandbox using CVAR as limit + NPP)
- ------------------------------------
- local function CanSpawnEnt(user)
- local MaxProps = cvars.Number("sbox_maxprops",0)
- local ThingsUnfiltered = ents.GetAll()
- local Filtered = {}
- local CheckFor = {"gmod_button","keypad","keypad_advanced","prop_physics"} -- afaik the buttons etc. are counted as props on server
- for _,Thing in ipairs(ThingsUnfiltered) do
- for i,Class in pairs(CheckFor) do
- if(Thing:GetClass() == Class&&NADMOD.PropOwners[Thing:EntIndex()] == LocalPlayer():Nick()) then
- table.insert(Filtered,Thing)
- end
- end
- end
- local ThingsCount = table.Count(Filtered)
- return (ThingsCount < MaxProps)
- end
- -----------------------------------
- Add the function to prop_functions.lua
- You can put it almost everywhere, mine starts at line 14
- Now you need to actually stop spawning the entity, it's pretty easy
- Jump to line 55, add something similar to this:
- -----------------------------------
- if shift then
- if(!CanSpawnEnt()) then
- Warning("Attempted to stack over prop limit")
- return false
- end
- stack = GetConVarNumber( PA_.."stack_num")
- ...
- ...
- -----------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement