Hello, having a PropHunt server working on : [url]http://steamcommunity.com/sharedfiles/filedetails/?id=417565863[/url]
I wanted to improve my server but I am stuck with 2 scripts :
-The first script is for giving points when people taunt and give more points for longer taunts :
[CODE]function PS_GivePoints(ply)
if GAMEMODE:InRound() && ply:Alive() && (ply:Team() == TEAM_PROPS) then
local pointmult = 1
local pspoints = math.ceil(SoundDuration("taunts/spazz1.mp3") * pointmult) -- This is the name of the taunt
ply:PS_GivePoints(pspoints)
ply:PS_Notify("You've been given " .. pspoints .. " " .. POINTSHOP.Config.PointsName .." for taunting!")
end
end[/CODE]
The thing is :
-Where I put this script ?
-How can I make the script for many taunts ?
-The second script is for giving points when hunters kills props :
[CODE]
local amount = 0;
hook.Add( "PlayerDeath", "KillPoints", function( victim, weapon, killer)
if( IsValid( killer ) and IsValid( victim ) ) then
if( killer:IsPlayer() and victim:IsPlayer() ) then
if ( killer:Team() == TEAM_HUNTERS and victim:Team() == TEAM_PROPS ) then
killer:PS_GivePoints( 5 );
killer:PS_Notify("Tu a gagné 5 points pour avoir tué un prop !"); -- Yea it's a french server
end;
end;
end;
end )[/CODE]
Where should I put this script ?
Thanks for people who will help me, I can help for somes scripts on prophunt.
First one is serverside [url]http://pointshop.burt0n.net/player-meta-functions/utilities[/url] [url]http://pointshop.burt0n.net/player-meta-functions/points[/url]. The second one is serverside. [url]https://wiki.garrysmod.com/page/GM/PlayerDeath[/url].
Well I've put the 2nd one in lua/autorun/server and it didn't work
Does it need a restart server ?
You should always restart the server after putting a new file into a directory, it likely won't load it.
I've restarted the server then, and the script don't work
Any script errors? Did you make sure the file extension is .lua?
Well, no error when hunters kills props and no error on connect. And yes the file extension is in .lua
Edit and in the 1st script, for many taunts, should i put the script like this : ?
[CODE]function PS_GivePoints(ply)
if GAMEMODE:InRound() && ply:Alive() && (ply:Team() == TEAM_PROPS) then
local pointmult = 1
local pspoints = math.ceil(SoundDuration("taunts/spazz1.mp3") * pointmult) -- This is the name of the taunt
ply:PS_GivePoints(pspoints)
ply:PS_Notify("You've been given " .. pspoints .. " " .. POINTSHOP.Config.PointsName .." for taunting!")
end
local pointmult = 1
local pspoints = math.ceil(SoundDuration("taunts/chacarron.mp3") * pointmult) -- This is the name of the taunt
ply:PS_GivePoints(pspoints)
ply:PS_Notify("You've been given " .. pspoints .. " " .. POINTSHOP.Config.PointsName .." for taunting!")
end
end[/CODE]
Sorry, you need to Log In to post a reply to this thread.