Hello I have a problem, I would like to create custom footstep for some playermodel and I succeeded but the problem is that I only hear them and not the other players.
After that if you have another solution that does with the DarkRP job I do not say no.
Code LUA:
function ManageRoboFeet( ply, pos, foot, sound, volume, rf )
--function made by babyfawnlegs, I came up with some of it but I needed to steal the hook because I'm shit at this stuff
if ply:GetModel() == "models/cyberlord/gaunter/cyberlord.mdl" then
ply:EmitSound( "cybermen/step.wav", 30, math.random(90,100 ))
return true
end
if ply:GetModel() == "models/cyberman/gaunter/cyberleader.mdl" then
ply:EmitSound( "cybermen/step.wav", 30, math.random(90,100 ))
return true
end
if ply:GetModel() == "models/cybersuperior/gaunter/cybersuperior.mdl" then
ply:EmitSound( "cybermen/step.wav", 30, math.random(90,100 ))
return true
end
if ply:GetModel() == "models/cybermen/bloodcyberman.mdl" then
ply:EmitSound( "cybermen/step.wav", 30, math.random(90,100 ))
return true
end
if ply:GetModel() == "models/cyberman/burd/cyberman.mdl" then
ply:EmitSound( "cybermen/step.wav", 30, math.random(90,100 ))
return true
end
end
hook.Add("PlayerFootstep","ManageRoboFeet",ManageRoboFeet)
You should really be using a table for checks here since you're using the same sound
local stepModels = {
["models/cyberlord/gaunter/cyberlord.mdl"] = true,
["models/cyberman/gaunter/cyberleader.mdl"] = true,
["models/cybersuperior/gaunter/cybersuperior.mdl"] = true,
["models/cybermen/bloodcyberman.mdl"] = true,
["models/cyberman/burd/cyberman.mdl"] = true,
}
if (stepModels[ply:GetModel()]) then
--sound stuff here
end
others probably cant hear it because you set the sound level to 30 which is abysmally low. try a value of 70 or something
Hello just try but it does not work, I think I'm wrong in the code:
function ManageRoboFeet( ply, pos, foot, sound, volume, rf )
local stepModels = {
["models/cyberlord/gaunter/cyberlord.mdl"] = true,
["models/cyberman/gaunter/cyberleader.mdl"] = true,
["models/cybersuperior/gaunter/cybersuperior.mdl"] = true,
["models/cybermen/bloodcyberman.mdl"] = true,
["models/cyberman/burd/cyberman.mdl"] = true,
}
if (stepModels[ply:GetModel()]) then
ply:EmitSound( "cybermen/step.wav", 65, math.random(90,100 ))
end
hook.Add("PlayerFootstep","ManageRoboFeet",ManageRoboFeet)
Sorry, you need to Log In to post a reply to this thread.