• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[REQUEST][LUA/PHP] Reset System PERFECT@

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
I wanted a perfect script reset
you come and talk to the npc

BR
NPC - Você gostaria de resetar seu character? diga apenas "sim"
Player - sim
NPC - Você vai ser kickado em 5 segundos e vai voltar para o lvl 8, e vai ganhar 1kk

you do not understand, Portuguese?
google translate ;]

http://translate.google.com.br

reset at level 350

[/PHP]
add one more line Reset
and
characters.php
show reset's



REP+ :wub::wub:
 
Last edited:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid)				npcHandler:onCreatureAppear(cid)			end
function onCreatureDisappear(cid)			npcHandler:onCreatureDisappear(cid)			end
function onCreatureSay(cid, type, msg)			npcHandler:onCreatureSay(cid, type, msg)		end
function onThink()					npcHandler:onThink()					end

function creatureSayCallback(cid, type, msg)
	if(not npcHandler:isFocused(cid)) then
		return false
	end

	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

	if msgcontains(msg, "reset") then
		if getPlayerLevel(cid, 350) then
			npcHandler:say("Do you want to reset your character?", cid)
			talkState[talkUser] = 1
		else
			npcHandler:say("You need to be level 350 or higher to reset your character.", cid)
		end
	end
	
	if msgconains(msg, "yes") and talkState[talkUser] == 1 then
		npcHandler:say("You will be kicked, reseted to level 8 and win 1kk. Are you sure?", cid)
		talkState[talkUser] = 2
	end
	
	if msgcontains(msg, "yes") and talkState[talkUser] == 1 then
		doPlayerAddExperience(cid, -getExperienceForLevel(getPlayerLevel(cid))
		doPlayerAddExperience(cid, getExperienceForLevel(8)
		talkState[talkUser] = 0
		doRemoveCreature(cid)
	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
no idea if it will work, was a while ago I made npcs ;p
 
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid)				npcHandler:onCreatureAppear(cid)			end
function onCreatureDisappear(cid)			npcHandler:onCreatureDisappear(cid)			end
function onCreatureSay(cid, type, msg)			npcHandler:onCreatureSay(cid, type, msg)		end
function onThink()					npcHandler:onThink()					end

function creatureSayCallback(cid, type, msg)
	if(not npcHandler:isFocused(cid)) then
		return false
	end

	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

	if msgcontains(msg, "reset") then
		if getPlayerLevel(cid, 350) then
			npcHandler:say("Do you want to reset your character?", cid)
			talkState[talkUser] = 1
		else
			npcHandler:say("You need to be level 350 or higher to reset your character.", cid)
		end
	end
	
	if msgconains(msg, "yes") and talkState[talkUser] == 1 then
		npcHandler:say("You will be kicked, reseted to level 8 and win 1kk. Are you sure?", cid)
		talkState[talkUser] = 2
	end
	
	if msgcontains(msg, "yes") and talkState[talkUser] == 1 then
		doPlayerAddExperience(cid, -getExperienceForLevel(getPlayerLevel(cid))
		doPlayerAddExperience(cid, getExperienceForLevel(8)
		talkState[talkUser] = 0
		doRemoveCreature(cid)
	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
no idea if it will work, was a while ago I made npcs ;p

thx man :p :wub:


@EDIT
missing someone get PHP

@EDIT ²
you can put the player vip to reset at level 315.
vip function:
Code:
if vip.hasVip(cid) == TRUE then
 
Last edited:
^ no u_u

Code:
function creatureSayCallback(cid, type, msg)
	if(not npcHandler:isFocused(cid)) then
		return false
	end

	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

	if msgcontains(msg, "reset") then
		if getPlayerLevel(cid, 350) then
              if vip.hasVip(cid) and getPlayerLevel(cid) >= 315 then
			npcHandler:say("Do you want to reset your character?", cid)
			talkState[talkUser] = 1
		else
			npcHandler:say("You need to be level 350 or higher to reset your character.", cid)
		end
	end
	
	if msgconains(msg, "yes") and talkState[talkUser] == 1 then
		npcHandler:say("You will be kicked, reseted to level 8 and win 1kk. Are you sure?", cid)
		talkState[talkUser] = 2
	end
	
	if msgcontains(msg, "yes") and talkState[talkUser] == 1 then
		doPlayerAddExperience(cid, -getExperienceForLevel(getPlayerLevel(cid))
		doPlayerAddExperience(cid, getExperienceForLevel(8)
		talkState[talkUser] = 0
		doRemoveCreature(cid)
	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Back
Top