Hello, currently trying to create a round script but this it is returning a nil value
round
round = round or {}
local roundStatus = 0 // 0 for stopped, 1 for on-going
It really pissed me off that I couldn't get 0 to have a space between for in this 'new' code formatting thing
round.beginRound()
function round.beingRound()
roundStatus = 1
round.updateClient()
end
round.updateClient()
function round.updateClient()
net.Start("roundUpdateCL")
net.WriteInt(roundStatus, 1)
net.Broadcast()
end
Receiver for roundUpdateCL
net.Receive("roundUpdateCL", function(len)
roundStatus = net.ReadInt(1)
end)
I got this error while creating my HUD to start the game, here's the error
[ERROR] gamemodes/overload/gamemode/core/lobby/sv_lobby.lua:13: attempt to call field 'beginRound' (a nil value)
1. func - gamemodes/overload/gamemode/core/lobby/sv_lobby.lua:13
2. unknown - lua/includes/extensions/net.lua:32
sv_lobby.lua:13
net.Receive("startGame", function() round.beginRound() end)
How the client is receiving it:
startBut.DoClick = function()
net.Start("startGame")
net.SendToServer()
frame:Close()
end
You mispelled
function round.beingRound()
roundStatus = 1
round.updateClient()
end
Oh shit 0.o I was overlooking my mistakes :P I will also use the Bools, didn't know they existed
Sorry, you need to Log In to post a reply to this thread.