Probably many of you answering these questions have answered one of mine before, and heres another one! (I really like experimenting). After playing on a server I saw that an Admin was able to set the gravity of a single person to a value (sbox_gravity x, but for players, thats for global). I found Entity:SetGravity(), am I able to replace Entity with something that would make the target_ply be affected? This is what I have so far. I get the error:
[ERROR] addons/ulx/lua/ulx/modules/sh/plygrav.lua:4: attempt to index local 'target_ply' (a nil value)
1. call - addons/ulx/lua/ulx/modules/sh/plygrav.lua:4
2. __fn - addons/ulib/lua/ulib/shared/commands.lua:942
3. unknown - addons/ulib/lua/ulib/shared/commands.lua:1295
4. unknown - lua/includes/modules/concommand.lua:54
local CATEGORY_NAME = "Advanced Simplicity"
function ulx.gravity( calling_ply, target_ply, string )
target_ply:SetGravity( "" .. string .. "" )
ulx.fancyLogAdmin( calling_ply, "#A has the set gravity of #T to #s", target_ply, string )
end
local gravity = ulx.command( CATEGORY_NAME, "ulx gravity", ulx.gravity, "!gravity" )
gravity:defaultAcess( ULib.ACCESS_ADMIN )
gravity:help( "Changes the value of a players gravity." )
Also, since I am getting errors and when I do !gravity in chat it says I dont have permissions the errors fixed should show up when I try to add permissions in the groups tab under superadmin.