Forum

> > CS2D > Scripts > Couldn't find a solution
Forums overviewCS2D overview Scripts overviewLog in to reply

English Couldn't find a solution

12 replies
To the start Previous 1 Next To the start

old Couldn't find a solution

script favor
User Off Offline

Quote
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

old Re: Couldn't find a solution

Mora
User Off Offline

Quote
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 File does not exist (17457)?
There is approximately something like you want. You can follow this style. I once found it pretty best for myself ;d

old Re: Couldn't find a solution

Mora
User Off Offline

Quote
@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.
edited 1×, last 02.02.18 06:37:25 pm

old Re: Couldn't find a solution

Waldin
User Off Offline

Quote
user Mora has written
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

old Re: Couldn't find a solution

Mora
User Off Offline

Quote
user Waldin has written
user Mora has written
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.

old Re: Couldn't find a solution

Talented Doge
User Off Offline

Quote
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.

old Re: Couldn't find a solution

Masea
Super User Off Offline

Quote
@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.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview