Forum

> > CS2D > Scripts > food friend script
Forums overviewCS2D overview Scripts overviewLog in to reply

English food friend script

8 replies
To the start Previous 1 Next To the start

old food friend script

Muxye
User Off Offline

Quote
hello i want to make food friend with food skin i mean like a cheese friend or bread friend so he must say me something and give me something if i won't to get something so maybe somebody have any ideas to help me with that. i have not working script:
1
2
3
4
5
6
7
8
9
10
11
12
addhook(always,random)
function random()
random=math.random(90)

addhook(join,friend)
function friend()
friends=1
if friends==1 then
msg2(id,"hi there!")
if txt=="give me something" then
parse("equip ..id.. random")
end

old Re: food friend script

_oops
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
addhook("always","always_random")
function always_random()
item=math.random(1,90)
end


addhook("join","friend")
function friend(id)
msg2(id,"hi there!")
end

addhook("say","friendly_say")
function friendly_say(id,txt)
	if txt=="give me something" then
	parse("equip "..id.." "..item)
	end
end

old Re: food friend script

Muxye
User Off Offline

Quote
@user _oops: thank you but im opening cs2d and i cant see my bread/cheese friend and i think he wont to talk with me

old Re: food friend script

muxarus
User Off Offline

Quote
@user Muxye: open "cs2d folder/sys/server.cfg" then write in empy place:
1
mp_luaserver "server.lua"
, create server.lua at "cs2d folder/sys/lua/server.lua" and then write your code, save, start cs2d, create a server! it works! i hope i helped you.

old Re: food friend script

GeoB99
Moderator Off Offline

Quote
muxarus has written
, create server.lua at "cs2d folder/sys/lua/server.lua" and then write your code, save, start cs2d, create a server! it works! i hope i helped you.

Obviously, you mean in lua folder not in server.lua

@user Muxye: If you mean why the script doesn't show anything while you are in your server is because you didn't activated the script in server.lua (writting dofile).
Just create a lua file (e.g. examplelua.lua) copy the fixed code (a working code) in that lua file and paste the lua in CS2D/sys/lua.
After that, open server.lua you must write the dofile (this is used to activate the scripts but this is not really necessary if the script is pasted in autorun file) and an example of a dofile is this:

1
dofile ("sys/lua/examplelua.lua")
If you write --dofile (with -- lines) then you prevent the specific script to work.

Then open the CS2D, create a server in new game and you're done!

old Re: food friend script

Muxye
User Off Offline

Quote
@user GeoB99: okay thanks good food friend noow i have on my serever air friend! imma so stupid to creat something without help
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview