• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua [Creaturescript] OnAdvance ...

Status
Not open for further replies.

Red

Cyntara.org & Evolunia.net
Staff member
Global Moderator
Premium User
Joined
Aug 9, 2008
Messages
4,495
Solutions
2
Reaction score
952
Location
Ohio, USA
Hi, I need a simple script that teleports players to the temple, gives them a certain storage value, and sends them a message once they reach level 600. My old script isn't working (I have no idea why).

Old script
Code:
function onAdvance(cid, skill, oldLevel, newLevel)
	if newLevel <= oldLevel then
		return true
	end

	if skill == SKILL__LEVEL then
		if getCreatureStorage(cid, 21041) == EMPTY_STORAGE and newLevel == 600 then
			doTeleportThing(cid, Position(780,704,7))
			setPlayerStorageValue(cid,21041,1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have grown up.')
		end
	end

	return true
end

And I've done everything required for a creaturescript to work, but it's not working (no error description). All the script above does is add the storage value. It doesn't send the message nor teleport the player to the temple.

I appreciate any help greatly.
Red
 
try add "true" in doTeleportThing:
Code:
doTeleportThing(cid, Position(780,704,7),[b][color="red"]true[/color][/b])
or replace
Code:
Position(780,704,7)
with the actual position.
 
  • Like
Reactions: Red
Thanks, Fallen. I needed to add ,true after the coordinates. It works perfectly! Rep+

Red
 
Status
Not open for further replies.
Back
Top