All right, so currently I have the following code:
[lua]function setMaxVel(ply, cmd, args)
local Settings = {}
Settings.MaxVelocity = args[1]
physenv.SetPerformanceSettings(Settings)
MsgN("Phys settings changed")
end
function setMaxAngVel(ply, cmd, args)
local Settings = {}
Settings.MaxAngularVelocity = args[1]
physenv.SetPerformanceSettings(Settings)
MsgN("Phys settings changed")
end
concommand.Add("phys_vel", setMaxVel)
concommand.Add("phys_angvel", setMaxAngVel)[/lua]
I put it on my server in the "garrysmod/garrysmod/lua" folder called "script.lua"
When I'm on my server I do "rcon lua_openscript script.lua" and it prints it's running the script.
Then I can do stuff like "rcon phys_vel 30000", and it prints "Phys settings changed", but nothing changes (Props are still limited to some ~2000 velocity) and I have no idea why so that's why I'm asking for help.
Have you checked if the convar was changed? (sv_maxvelocity, etc.)
Isnt source's velocity limit ALOT lower than 30000?
It didn't change, however if I just did something like:
[lua]
Settings = {}
Settings.MaxVelocity = 36000
physenv.SetPerformanceSettings(Settings)
[/lua]
And I run that script, then it does work.
I'm quite sure arguments from concommands are strings.. Try tonumber() around args[1] in both concommands.
Sorry, you need to Log In to post a reply to this thread.