ConCommands, what am I doing wrong here?

So heres my code:


concommand.Add( "NovaSuperSpeed", function( ply, cmd, args )
	RunConsoleCommand("walkOnWater", "1")
	game.SetTimeScale(0.03)			
	player:SetLaggedMovementValue(38)	
	player:SetJumpPower( 443 )			-
	RunConsoleCommand("sv_defaultdeployspeed", "70")	
	if slow == 0 then									
	self.Owner:ChatPrint ("Let's run!")	-- You see stephano? This is what happens!
	slow = 1
	
	if PlayMusic == 1 then
	
	if math.random (1, 2) == 1 then
			self.Owner:EmitSound("music/TimeBottle.mp3")
	else
			self.Owner:EmitSound("music/SweetDreams.mp3")
	
	end 
	else
			self.Owner:ChatPrint ("Looks your already going fast kid!")
	end 
	elseif PlayMusic == 0 then
	
		self.Owner:ChatPrint ("Music is disabled :)") 
	end 
end)



concommand.Add( "NovaNormalSpeed", function( ply, cmd, args )
	RunConsoleCommand("walkOnWater", "0")
	game.SetTimeScale(1)
	RunConsoleCommand( "Stopsound") 
	self.Owner:SetJumpPower( 200 )
	RunConsoleCommand("sv_defaultdeployspeed", "1")
	self.Owner:SetLaggedMovementValue(1) 
	slow = 0
	moo = 0
end)

I’m getting the error:



[ERROR] addons/quicksilver/lua/weapons/weapon_quicksilver_mod/shared.lua:143: attempt to call method 'SetLaggedMovementValue' (a nil value)
  1. unknown - addons/quicksilver/lua/weapons/weapon_quicksilver_mod/shared.lua:143
   2. unknown - lua/includes/modules/concommand.lua:54


Line 143 is


player:SetLaggedMovementValue(38)

Any help would be appreciated :slight_smile:

Your concommand is in a shared file, so the command is being executed on both the server and client.
The function SetLaggedMoementValue does not exist on the client.

Oh, ok. But if this is the case, why does it work when you place it on a weapons PrimaryAttack function? Thanks

It’ll only work in single-player since PrimaryAttack is only called serverside in single-player.

Ah, Ok thanks!