Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (self.Owner:Team() == FACTION_NINJA) then
- function Spell:OnFire(wand)
- local ent = wand:HPWGetAimEntity(250)
- if IsValid(ent) then
- if ent:IsPlayer() then
- if (ent:Team() == FACTION_NINJA) then
- local name = "hpwrewrite_walkspeeden_handler" .. ent:EntIndex()
- if hook.GetTable()["Think"][name] then return end
- local oldspeed = ent:GetRunSpeed()
- local newspeed = oldspeed * 4
- local speed = oldspeed
- local inverse = false
- hook.Add("Think", name, function()
- if not IsValid(ent) then
- hook.Remove("Think", name)
- return
- end
- ent:ConCommand("+forward")
- ent:ConCommand("+speed")
- ent:ConCommand("-back")
- if inverse then
- speed = math.Approach(speed, oldspeed, FrameTime() * 200)
- if speed <= oldspeed then
- hook.Remove("Think", name)
- ent:ConCommand("-forward")
- ent:ConCommand("-speed")
- end
- else
- speed = math.Approach(speed, newspeed, FrameTime() * 300)
- if speed >= newspeed then
- inverse = true
- end
- end
- ent:SetRunSpeed(speed)
- end)
- --if (ent():Team() != FACTION_NINJA) then
- -- ent:notify("Not the right class!")
- -- return false
- --end
- end
- end
- end
- end
- else
- return
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement