Server Script Not Working?

I have a script saved in my server files at: lua/autorun/server

The script is:
[lua]
if SERVER then
hook.Add(“OnPlayerChangedTeam”, “DutyGod”, function(ply, oldteam, newteam)
if newteam == TEAM_MODERATORONDUTY then
ply:SetWalkSpeed(480)
ply:SetRunSpeed(765)
end
if oldteam == TEAM_MODERATORONDUTY then
ply:SetWalkSpeed(160)
ply:SetRunSpeed(255)
end
end )
end
if CLIENT then
end
[/lua]

Yet it doesn’t work. I did some testing and the IF statements do get triggered but the ply:setwalkspeed ect doesn’t work, is ply wrong? If so how do I get it as it should be right from the hook…

just wanna let you know, no need to check if the server is running the code if your file is placed in lua/autorun/server

any errors showing up in server console?

Yeah I know the if SERVER isn’t needed but I wanted to make sure it was running server-side :slight_smile:

No errors come up in console as far as I can see…

You don’t seem to know it.

[lua]
if CLIENT then
end
[/lua]

cough cough not needed either cough cough

that literally does nothing if you’re not going to return…

I meant it is not needed, because it does nothing.