English Can't make physics sample work

4 replies
Goto Page
To the start Previous 1 Next To the start
Up
Goo
User
Offline Off
Code:
1
2
Lua Physics Error: API call without initialization
LUA ERROR: sys/lua/physics.lua:285: bad argument #1 to 'physics_setmass' (number expected, got boolean)

I did a little digging and it gets
false
.

I get this on a
server.lua
:
Code:
1
2
3
dofile("sys/lua/physics.lua")
dofile("sys/lua/samples/physics_collisions.lua")
dofile("sys/lua/samples/physics_cars.lua")


Which I ran on a 200x200 map filled with nothing but grass tiles.

I don't know why it doesn't work.
12.05.19 07:39:36 am
Up
Jaller94
User
Offline Off
The imports are fine.
Something inside those files must call the function with invalid parameters.
12.05.19 08:04:15 am
Up
Goo
User
Offline Off
I haven't modified those files...

EDIT: Problem found, had to set
sv_physics
to
1
edited 1×, last 12.05.19 10:18:40 am
12.05.19 12:02:56 pm
Up
Gaios
Security Supporter
Offline Off
Ha.. you better learn basics than scripting physics now..
12.05.19 12:33:58 pm
Up
Goo
User
Offline Off
I learn what I want because I'm scripting for fun
To the start Previous 1 Next To the start