Random Script Error Deathrun

Hello I was playing with some other players on my Deathrun server and randomly ran into some script errors I have never seen before here is the error


[ERROR] gamemodes/deathrun/gamemode/cl_init.lua:76: attempt to call method 'GetRoundTime' (a nil value)
  1. unknown - gamemodes/deathrun/gamemode/cl_init.lua:76

Any help would be appreciated

Can you post a link to the gamemode files (eg, where you downloaded it).

I seem to have fixed it i forgot earlier that i tried to add a team value in the shared.lua file to change the players movement speed with this team.SetWalkSpeed( 500 walkSpeed ) so i removed that and there are no more script errors. But do you have any idea on how to change the movement speed per team?

In a spawn hook, set the player’s walk speed dependant on which team they are in.

hook.Add,

Player:Team,

Player:SetWalkSpeed.

Or, you could create player classes, and set their classes when you setup the teams.

player_manager.RegisterClass.

team.SetClass

What file would this be located in?

init.lua, or any other serverside file.

okay thanks ill try that and message you if i need anymore help with this

One more question what would the hook be called

As in, the first argument? PlayerSpawn.

Okay what about identifier and function

The identifier is what ever you want it to be (within reason, you don’t want to overwrite another hook, so set it to something you know won’t have been set before). The function is the function where you check the team, and set the player’s speed accordingly.

Sorry this is all kinda confusing im quite new to lua but i know some of it would you be able to write a lua code to set the players speed to 500 if they are on the death team and 400 if they are on runner?

Seeing as I have no idea what the team indexes are, you will have to fix the if conditions to suit your need.

[lua]
hook.Add( “PlayerSpawn”, “CauseLookingThingsUpIsHard”, function( ply )
– First argument is the name of the thing you’re hooking into. When a player spawns.
– Second argument is the identifier, in case you want the hook during runtime.
– This (the function in which these comments are) is the function that gets called

if ( ply:Team() == TEAM_DEATH ) then 	-- If the player's team is death, then
	ply:SetWalkSpeed( 500 )				-- Set their walk speed
elseif ( ply:Team() == TEAM_RUNNER ) then -- If not, if the player's team is runner, then
	ply:SetWalkSpeed( 400 )				-- You get the idea
end

end)
[/lua]

Your challenge is now to change the run speed.

Player:SetRunSpeed. Use the code above to guide you.

thank you so much, after seeing an example it all makes a little more sense

[editline]20th April 2015[/editline]

after i added that into shared.lua i started getting the error from the top of this thread

[editline]20th April 2015[/editline]

alright i fixed the error but the players speed didnt change but i did change there walk speeds to 700 and 600

The gamemode is likely setting it’s own player speeds. Can you post a link to the Deathrun gamemode you are using?