• 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!

Step-in create effect

Djivar

AKA Wickedviruz
Joined
Sep 28, 2009
Messages
1,641
Reaction score
20
Location
Sweden,edsbyn
Hello dear OtLanders, I'm asking for a script O.o
and i want it ti be like this, when you log in to the
server for the first time in tempel you will get
An effect over a teleport and the effect number is 56
But this will only show one time, and thats when you log in
And when after that i want like the same script. when you step in
on a teleport and are in the new pos there will be a new effect
on another place, but this will only be the first time you step in
on the teleport. and ofc the effect is going to be 56,
That one who help/make the script for me is going to get rep+
And if you dont understan try to leave a comment so i can explain better​

regards,
Djivar
 
name this firstlogon.xml

LUA:
local s = 65
function onLogin(cid)
	if getPlayerStorageValue(cid,s) <= 0 then
	local v = getThingPos(cid)
		setPlayerStorageValue(cid,s,1)
		return doSendMagicEffect(v, 56)
	end
end

add to creaturescripts.xml
LUA:
<event type="login" name="FirstLogon" event="script" value="firstlogon.lua"/>

add to login.xml
LUA:
registerCreatureEvent(cid, "firstLogon")
 
I made it so that where the player is, the effect shows.

LUA:
local s, pos =  65, {x=1,y=1,z=1}
function onLogin(cid)
        if getPlayerStorageValue(cid,s) <= 0 then
                setPlayerStorageValue(cid,s,1)
                return doSendMagicEffect(pos, 56)
        end
end

you can change it in this one
 
try adding this into login.lua

LUA:
if getPlayerStorageValue(cid,65) <= 0 then
    local v = {x=1,y=1,z=1}
        setPlayerStorageValue(cid,65,1)
        return doSendMagicEffect(v, 56)
end

just put it under the isplayerghost check or something.
Remove the scripts from creaturescripts.xml
 
Where ? :O
LUA:
local config = {
	loginMessage = getConfigValue('loginMessage')
}

function onLogin(cid)
    local loss = getConfigValue('deathLostPercent')
    if(loss ~= nil) then
        doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
    end  

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "TopFrags")
	registerCreatureEvent(cid, "GuildMotd")
	registerCreatureEvent(cid, "demonOakLogout")
	registerCreatureEvent(cid, "demonOakDeath")
	registerCreatureEvent(cid, "Idle")
	registerCreatureEvent(cid, "SkullCheck")
	registerCreatureEvent(cid, "ReportBug")
        registerCreatureEvent(cid, "KillingInTheNameOf")
        registerCreatureEvent(cid, "MonsterPortal")
        registerCreatureEvent(cid, "MonsterKill")
	registerCreatureEvent(cid, "gilderwand")
	registerCreatureEvent(cid, "pvparena")
	registerCreatureEvent(cid, "quest")
	return true
end
 
LUA:
local config = {
	loginMessage = getConfigValue('loginMessage')
}

function onLogin(cid)
    local loss = getConfigValue('deathLostPercent')
    if(loss ~= nil) then
        doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
    end  

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

        if getPlayerStorageValue(cid,65)  <= 0 then
        local v = {x=1,y=1,z=1}
               setPlayerStorageValue(cid,65,1)
               return doSendMagicEffect(v, 56)
        end 

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "TopFrags")
	registerCreatureEvent(cid, "GuildMotd")
	registerCreatureEvent(cid, "demonOakLogout")
	registerCreatureEvent(cid, "demonOakDeath")
	registerCreatureEvent(cid, "Idle")
	registerCreatureEvent(cid, "SkullCheck")
	registerCreatureEvent(cid, "ReportBug")
        registerCreatureEvent(cid, "KillingInTheNameOf")
        registerCreatureEvent(cid, "MonsterPortal")
        registerCreatureEvent(cid, "MonsterKill")
	registerCreatureEvent(cid, "gilderwand")
	registerCreatureEvent(cid, "pvparena")
	registerCreatureEvent(cid, "quest")
	return true
end

here you go ^_^
 
Omg the king is here to save me(A) but now i need almost the same script. i need when you stepin on a teleportal for the first time you will get a new effect, effect 55, on another position :)
 
LUA:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if item.actionid == 1312 then
	local v,s = {x=1,y=1,z=1},2560
		if getPlayerStorageValue(cid,s) <= 0 then
			doTeleportThing(cid, v)
			doSendMagicEffect(v, 56)
			return setPlayerStorageValue(cid,s,1)
		end
	end
end

Hmm try this, I never create movements for tp actually.
 
Back
Top