Forum

> > CS2D > Scripts > food friend script
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch food friend script

8 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt food friend script

Muxye
User Off Offline

Zitieren
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

alt Re: food friend script

_oops
User Off Offline

Zitieren
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

alt Re: food friend script

muxarus
User Off Offline

Zitieren
@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.

alt Re: food friend script

GeoB99
Moderator Off Offline

Zitieren
muxarus hat geschrieben
, 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!

alt Re: food friend script

Muxye
User Off Offline

Zitieren
@user GeoB99: okay thanks good food friend noow i have on my serever air friend! imma so stupid to creat something without help
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht