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

Lua Broadcast player script

x1nject

New Member
Joined
Apr 24, 2010
Messages
118
Reaction score
0
I need a script so when a player gets Level 80 it will broadcast to him only: "Now that you have reached level 80 your automatic bless will be disabled, there for you now have to buy them!"

And it would use storages so it doesn't come up all the time

+rep
 
Message at lvl 80

make new lua file at \data\creaturescripts\scripts named: bless.lua

PHP:
if(getPlayerStorageValue(cid, 99963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 80) then
                doPlayerSendTextMessage(cid, 22, "Now that you have reached level 80 your automatic bless will be disabled, there for you now have to buy them!")
                end
        return TRUE
end

and paste this in creaturescripts.xml

PHP:
      <event type="advance" name="bless" event="script" value="bless.lua"/>


REP +



:peace:
 
Code:
function onAdvance(cid, skill, oldLevel, newLevel)
	if newLevel >= 80 and getPlayerStorageValue(cid, oldLevel) == -1 then
		doBroadcastMessage(os.date("%H:%M:%S", os.time()) .. " " .. getCreatureName(cid) .. ": You have reached level " .. newLevel .. " your automatic bless will be disabled there for you now you have to buy them!", 20)
		setPlayerStorageValue(cid, oldLevel, 1)
	end
	return true
end
 
@up everytime the person level it broadcasting, so if he lv 100 it saying it i only need to say once at lv 80 and i dont want it to broadcast to server to just only send player message.
 
Lua:
function onAdvance(cid, skill, oldLevel, newLevel)
	if skill == 1 and newLevel == 80 then
		doBroadcastMessage(os.date("%H:%M:%S", os.time()) .. " " .. getCreatureName(cid) .. ": You have reached level " .. newLevel .. " your automatic bless will be disabled there for you now you have to buy them!", 20)
	end
	return true
end

You do not need storages, it will work only for people who get level 80.
 
Back
Top