Forum

> > CS2D > Scripts > how can imake
Forums overviewCS2D overview Scripts overviewLog in to reply

English how can imake

8 replies
To the start Previous 1 Next To the start

moved how can imake

Kantos
BANNED Off Offline

Quote
what need to add what u can restart level just from 50 lvl
NPCs[18].func = function(npc, id, words, state)
if words == "hi" then
NPCspeak(npc, "Greetings! Say 'reset' if you need to reset your level.")
PLAYERS[id].tmp.npcstate = {npc, 1}
elseif contains(words, "bye") then
NPCspeak(npc, "Goodbye.")
PLAYERS[id].tmp.npcstate = nil
elseif state == 1 then
if contains(words, "reset") then
NPCspeak(npc, "Would you like to reset your level for $10?")
PLAYERS[id].tmp.npcstate = {npc, 2}
end
elseif state == 2 then
if contains(words, "yes") then
if addmoney(id, -10) then
message(id, "You have lost $10.", "255255255")
PLAYERS[id].Level = 1
PLAYERS[id].Experience = 1
updateHUD(id)
NPCspeak(npc, "Enjoy!")
PLAYERS[id].tmp.npcstate = nil
else
NPCspeak(npc, "Don't try to reset without paying!")
PLAYERS[id].tmp.npcstate = nil
end
elseif contains(words, "no") then
NPCspeak(npc, "Alright then.")
PLAYERS[id].tmp.npcstate = nil
end
end
end

Admin/mod comment

there's a scripting forum. use it for scripting questions.

old Re: how can imake

Bobakrome
User Off Offline

Quote
Untested

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
NPCs[18].func = function(npc, id, words, state)
	if words == "hi" then
		NPCspeak(npc, "Hey, do you wish to reset your level?")
		message(id, "You will gain 500000.", "100255100")
		message(id, "You must be atleast level 50.", "255100100")
		PLAYERS[id].tmp.npcstate = {npc, 1}
	elseif contains(words, "bye") then
		NPCspeak(npc, "Bai :3")
		PLAYERS[id].tmp.npcstate = nil
	elseif state == 1 then
		if contains(words, "yes") then
			NPCspeak(npc, "Are you sure?")
			PLAYERS[id].tmp.npcstate = {npc, 2}
		end
	elseif state == 2 then
		if contains(words, "yes") then
			if PLAYERS[id].Level >= 50 then
			elseif addmoney(id, 500000) then
			elseif addexp(id, -xxxxx) then -- REPLACE xxxxx WITH THE EXPERIENCE AMOUNT TO REMOVE!
				NPCspeak(npc, "Good luck in your jurney hero!")
				message(id, "You have gained 500000.", "255255255")
				parse("setmaxhealth " .. id .. " 250")
				PLAYERS[id].tmp.npcstate = nil
			else
				NPCspeak(npc, "You are not enought level for this!")
				PLAYERS[id].tmp.npcstate = nil
			end
		elseif contains(words, "no") then
			NPCspeak(npc, "Alright then.")
			PLAYERS[id].tmp.npcstate = nil
		end
	end
end

Should Work

Replace xxxxx from
1
elseif addexp(id, -xxxxx) then

xxxxx is the amount of xp to remove?

--EDIT more to work
--EDIT2 done!
--EDIT3 now its really done!
edited 3×, last 22.01.12 02:11:12 pm

old Re: how can imake

Kantos
BANNED Off Offline

Quote
its work but u can reset ur level when u are any level but i want what u can just restart if u are 50 level

old Re: how can imake

Kantos
BANNED Off Offline

Quote
lol i try is works but 1 thing u can restart if u are any level i need 50 :
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview