Forum

> > CS2D > Scripts > Couldn't find a solution
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Couldn't find a solution

12 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Couldn't find a solution

script favor
User Off Offline

Zitieren
Hello,
look i created script for not repeating the "!" in same cmds so when i write anything it cause to excute the all cmds :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
if dm == nil then dm = {}  end

					addhook("say","dm.say")


					cmds = { "kick" }
					 
					 function get_value()
					 for word in gmatch("!", "%a+") do 
						return loadstring(cmds[1]) 
						end
					 end

					function dm.LOAD_STRINGS(id)
						usgn = player(id,"usgn")
					end

					function dm.say(id,cmd) 
					  if cmds[1] and get_value then
						  msg("Your usgn is")
							else
							return loadstring(cmds[1]) 
						  end
					end

alt Re: Couldn't find a solution

Mora
User Off Offline

Zitieren
You're useless, as always, user Waldin. Remember, there is no such achievement as "Commentator: make 9000comments" or etc.

@user script favor: do you know user Hajt's file Datei existiert nicht (17457)?
There is approximately something like you want. You can follow this style. I once found it pretty best for myself ;d

alt Re: Couldn't find a solution

Mora
User Off Offline

Zitieren
@user script favor: nah you didn't write me on discord, i wont wait or ask you to ask me for your explanations. But well i've got you nicely and i show you that example where exists thing that you need in. You should need to download it and look into functions.
@user Waldin: ain't like somebody would want to find solution after the days of learning stuff, than just have it here like most people getting it.

About terraria, is a pretty nice game. But sadly no news are coming anymore. I finished it many times but is not what this topic about.
1× editiert, zuletzt 02.02.18 18:37:25

alt Re: Couldn't find a solution

Waldin
User Off Offline

Zitieren
user Mora hat geschrieben
You should need to download it and look into functions.

He can't. He definitively doesn't know scripting, thats why i shown (or showed idk lmao) him his solution.

i play terraria too but never killed plantera lmao

alt Re: Couldn't find a solution

Mora
User Off Offline

Zitieren
user Waldin hat geschrieben
user Mora hat geschrieben
You should need to download it and look into functions.

He can't. He definitively doesn't know scripting, thats why i shown (or showed idk lmao) him his solution.

i play terraria too but never killed plantera lmao


But somehow he did that script. It looks like he can do at least something. And Hajt's code is very understandable. Why do you sure he dont know how to script?

I always played with one guy and we had to kill double HP plantera together. Arena, healing lighters and other stuff to keep us alive, but not like where you found - broken - fight.

alt Re: Couldn't find a solution

Talented Doge
User Off Offline

Zitieren
I honestly do not get it why you use
gmatch
in the first place.
sub
is more than enough for parsing commands.

You may have a look into other admin scripts, take Flood's admin script as an example:

1
2
3
4
5
6
7
8
9
10
11
function f.cmds.onsay(id, txt)
	local sym = txt:sub(1, 1)
	if sym == "!" or sym == "@" then
		local space = txt:find(" ") or (#txt + 1)
		local cmd = txt:sub(1, space - 1)
		local wat = f.cmds.lut[cmd:lower()]
		if not wat then
			f_msg2(id, "sys", "Command does not exist.")
			return 1
end
..........

There he used
sub
to check for the prefix.

alt Re: Couldn't find a solution

Masea
Super User Off Offline

Zitieren
@user Mora: It's not hard to see that he doesn't know how to code. Look at that tab using. Peh. More like he did copy+past some code snippets and then showed the last state.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht