mirror of https://github.com/teverse/teverse
Compare commits
No commits in common. "698cc12615a9ed85de1e6bf44210b37e8b3cea30" and "a29d234bd6b8e4d1e02fda8ce9b8d533aacc8508" have entirely different histories.
698cc12615
...
a29d234bd6
|
@ -40,6 +40,7 @@ local function setupCharacterLocally(client, char)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function characterSpawnedHandler(newClientId)
|
local function characterSpawnedHandler(newClientId)
|
||||||
|
repeat wait() until engine.networking.me -- we shouldnt need to do this
|
||||||
print("spawning", newClientId, engine.networking.me.id)
|
print("spawning", newClientId, engine.networking.me.id)
|
||||||
if engine.networking.me.id == newClientId then
|
if engine.networking.me.id == newClientId then
|
||||||
print("waiting")
|
print("waiting")
|
||||||
|
@ -62,6 +63,10 @@ local function characterSpawnedHandler(newClientId)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
for _,v in pairs(engine.networking.clients.children) do
|
||||||
|
characterSpawnedHandler(v.id)
|
||||||
|
end
|
||||||
|
|
||||||
engine.networking.clients:clientConnected(function (client)
|
engine.networking.clients:clientConnected(function (client)
|
||||||
characterSpawnedHandler(client.id)
|
characterSpawnedHandler(client.id)
|
||||||
end)
|
end)
|
||||||
|
@ -169,7 +174,4 @@ engine.input:keyReleased(function (inputObj)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
repeat print(engine.networking.me) wait() until engine.networking.me
|
|
||||||
characterSpawnedHandler(engine.networking.me.id)
|
|
||||||
|
|
||||||
return controller
|
return controller
|
|
@ -9,13 +9,4 @@ print("Loaded Client")
|
||||||
require("tevgit:core/client/debug.lua")
|
require("tevgit:core/client/debug.lua")
|
||||||
require("tevgit:core/client/chat.lua")
|
require("tevgit:core/client/chat.lua")
|
||||||
require("tevgit:core/client/playerList.lua")
|
require("tevgit:core/client/playerList.lua")
|
||||||
require("tevgit:core/client/characterController.lua")
|
require("tevgit:core/client/characterController.lua")
|
||||||
|
|
||||||
workspace.camera.position = vector3(40, 15, 0)
|
|
||||||
workspace.camera:lookAt(vector3(0, 0, 0))
|
|
||||||
|
|
||||||
engine.construct("block", workspace, {
|
|
||||||
position = vector3(0, 10, 0),
|
|
||||||
static = false,
|
|
||||||
colour = colour(0.3, 0.3, 0.3)
|
|
||||||
})
|
|
|
@ -40,13 +40,11 @@ return {
|
||||||
name = "blueSphere",
|
name = "blueSphere",
|
||||||
colour = colour(0, 0, 1),
|
colour = colour(0, 0, 1),
|
||||||
size = vector3(1, 1, 1),
|
size = vector3(1, 1, 1),
|
||||||
position = vector3(0.5, 5, 0),
|
position = vector3(0.5, 1, 0),
|
||||||
mesh = "primitive:sphere",
|
mesh = "primitive:sphere",
|
||||||
roughness = 0.5,
|
roughness = 0.5,
|
||||||
metalness = 0.8,
|
metalness = 0.8
|
||||||
static = false
|
|
||||||
})
|
})
|
||||||
engine.physics:resume()
|
|
||||||
end,
|
end,
|
||||||
|
|
||||||
setupEnvironment = function ()
|
setupEnvironment = function ()
|
||||||
|
|
Loading…
Reference in New Issue