So I’m new to this networking thing, (glua in general lol) and i’ve done a system in which when you press shift you run faster. The thing is that it works perfectly, but I want to add that when you get to a speed the player is kind of ragdolled during a period of time (like he slipped and fell into the floor). It works completely well without the added code (which is the speed3 thing) but when i add it it gives me this error, even though all strings have been added (line 69 btw is the ‘net.Start(“wannaragdolls1”)’ thing)
[ERROR] lua/autorun/client/semi_perfect_scrip.lua:69: Calling net.Start with unpooled message name! [http://goo.gl/qcx0y]
1. Start - [C]:-1
2. fn - lua/autorun/client/semi_perfect_scrip.lua:69
3. unknown - addons/ulib_557962238/lua/ulib/shared/hook.lua:109
This is at serverside:
speedAt1 = 300 //speed at level 1
speedAt2 = 400 //speed at level 2
speedAt3 = 500 //speed at level 3
speedAt4 = 600 //speed at level 4
speedAt5 = 650 //speed at level 5
util.AddNetworkString( "speed1" )
util.AddNetworkString( "speed2" )
util.AddNetworkString( "speed3" )
util.AddNetworkString( "speed4" )
util.AddNetworkString( "speed5" )
net.Receive("speed1", function(len, ply)
GAMEMODE:SetPlayerSpeed( ply, speedAt1, speedAt1)
end
)
net.Receive("speed2", function(len, ply)
GAMEMODE:SetPlayerSpeed( ply, speedAt2, speedAt2)
end
)
net.Receive("speed3", function(len, ply)
GAMEMODE:SetPlayerSpeed( ply, speedAt3, speedAt3)
if ply:GetVelocity():Length() > 0 then
elseif ply:IsOnGround() == false then
elseif math.random(0,100) < 3 then
print("i work")
end
end
end
end)
net.Receive("speed4", function(len, ply)
GAMEMODE:SetPlayerSpeed( ply, speedAt4, speedAt4)
end
)
net.Receive("speed5", function(len, ply)
GAMEMODE:SetPlayerSpeed( ply, speedAt5, speedAt5)
end
)
Client code (not all the code but the part that contains the net start)
hook.Add("Think","ragdollTrigger", function(ply, mv)
if speed == 3 then
net.Start("speed3")
net.SendToServer()
end