Good script but it probably won't work with other scripts
here is the updated version:
local imgArray={}
for i=1, 32 do
imgArray[i]=0
end
addhook("say","say_hat")
function say_hat(id,txt)
if (txt=="!helmet") then
if(imgArray[id]~=0 and imgArray[id]~=nil) then freeimage(imgArray[id]) end
imgArray[id]=image("gfx/hats/helmet.bmp",1,1,200+id)
end
if (txt=="!spikes") then
if(imgArray[id]~=0 and imgArray[id]~=nil) then freeimage(imgArray[id]) end
imgArray[id]=image("gfx/hats/spikes.png",1,1,200+id)
end
if (txt=="!phoenix") then
if(imgArray[id]~=0 and imgArray[id]~=nil) then freeimage(imgArray[id]) end
imgArray[id]=image("gfx/hats/phoenix.png",1,1,200+id)
end
if (txt=="!corner") then
if(imgArray[id]~=0 and imgArray[id]~=nil) then freeimage(imgArray[id]) end
imgArray[id]=image("gfx/hats/wing5.bmp",1,1,200+id)
end
if (txt=="!nohat") then
if(imgArray[id]~=0 and imgArray[id]~=nil) then freeimage(imgArray[id]) end
end
if (txt=="!tyrans") then
if(imgArray[id]~=0 and imgArray[id]~=nil) then freeimage(imgArray[id]) end
imgArray[id]=image("gfx/hats/tyrans.bmp",1,1,200+id)
end
end
just add return 1, like:
if (txt=="!spikes") then
freeimage(id)
id=image("gfx/hats/spikes.png",1,1,200+id)
parse("speedmod "..id.." -100")
timer(1000,"parse","speedmod "..id.." 0")
return 1
end
I love and use it, it's so simple, and fun
How can i make the message like: !spike don't appears? Only the hat, and the return value be nil (i think it's that)
Like, i type: !spike
and the helmet appears, without the message on the chat.
There is bug, what ever hat you choose only player with ID=1 will have it. Soo here is fixed all(including !nohat)
addhook("say","say_hat")
function say_hat(id,txt)
if (txt=="!helmet") then
freeimage(id)
id=image("gfx/hats/helmet.bmp",1,1,200+id)
parse("speedmod "..id.." -100")
timer(1000,"parse","speedmod "..id.." 0")
end
if (txt=="!spikes") then
freeimage(id)
id=image("gfx/hats/spikes.png",1,1,200+id)
parse("speedmod "..id.." -100")
timer(1000,"parse","speedmod "..id.." 0")
end
if (txt=="!phoenix") then
freeimage(id)
id=image("gfx/hats/phoenix.png",1,1,200+id)
parse("speedmod "..id.." -100")
timer(1000,"parse","speedmod "..id.." 0")
end
if (txt=="!corner") then
freeimage(id)
id=image("gfx/hats/wing5.bmp",1,1,200+id)
parse("speedmod "..id.." -100")
timer(1000,"parse","speedmod "..id.." 0")
end
if (txt=="!nohat") then
freeimage(id)
end
if (txt=="!tyrans") then
freeimage(id)
id=image("gfx/hats/tyrans.bmp",1,1,200+id)
parse("speedmod "..id.." -100")
timer(1000,"parse","speedmod "..id.." 0")
end
end
I even added timer so when you change hat you will stay still for a second.
hi RyceR
I loved your script
I edited it to put on my server
I always use your script, because I find it very funny
there is only one problem
function !nohat not working
I would ask you to see this
Thanks