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

What's wrong with this script?

Sir Shutter

Learning LUA
Joined
Nov 17, 2008
Messages
1,437
Reaction score
10
Location
Egypt
Rep++If you fix!





The Script​

Code:
function onStepIn(cid, item, pos)
	if item.uid == 2616 then
		doPlayerSetTown(cid, 1)
		doPlayerSendTextMessage(cid, 21, 'Welcome to Hawai!')
		doSendMagicEffect({x=1026,y=400,z=7},13)
end

In the movements.xml​

Code:
        <movevent event="StepIn" itemid="1387" script="residence.lua"/>

-: More information :-​

It's the blue teleport, you should go in then send that effect, and say Welcome to hawai, and the itemID is correct, Unique id also correct , and it should change ur temple position to that position in i checked everything, somthing wrong with the script, if someone can know I give him rep++
 
function onStepIn(cid, item, pos)
if item.uid == 2616 then
doPlayerSetTown(cid, 1)
doPlayerSendTextMessage(cid, 21, 'Welcome to Hawai!')
doSendMagicEffect({x=1026,y=400,z=7},13)
end
end

you forgot about second "end"? xD
 
no idea then... try this:
movements.xml:
PHP:
<movevent event="StepIn" uniqueid="2616" script="residence.lua"/>


residence.lua:

function onStepIn(cid, item, pos)
if isPlayer(cid) == TRUE then
doPlayerSetTown(cid, 1)
doPlayerSendTextMessage(cid, 21, "Welcome to Hawai!")
doSendMagicEffect({x=1026,y=400,z=7},13)
end
return TRUE
end


any errors? xd
 
PHP:
function onStepIn(cid, item, pos)
	if isPlayer(cid) == TRUE then
		if item.uid == 2222 then
			doPlayerSetTown(cid, 1)
			doPlayerSendTextMessage(cid, 21, "Welcome to Hawai!")
			doSendMagicEffect({x=1026,y=400,z=7},13)
		end
	end
	return TRUE
end


If its not working its your fault not your script :D!
 
Code:
[COLOR="Navy"]function onStepIn[COLOR="SeaGreen"]([/COLOR]cid[COLOR="SeaGreen"],[/COLOR] item[COLOR="SeaGreen"],[/COLOR] pos[COLOR="SeaGreen"])[/COLOR]

	[COLOR="SeaGreen"]if[/COLOR] item.uid [COLOR="SeaGreen"]==[/COLOR] 2616 [COLOR="SeaGreen"]then[/COLOR]

		doPlayerSetTown[COLOR="SeaGreen"]([/COLOR]cid[COLOR="SeaGreen"],[/COLOR] 1[COLOR="SeaGreen"])[/COLOR]
		doPlayerSendTextMessage[COLOR="SeaGreen"]([/COLOR]cid[COLOR="SeaGreen"],[/COLOR] MESSAGE_INFO_DESCR[COLOR="SeaGreen"],[/COLOR] [COLOR="Red"]"Welcome to Hawai!"[/COLOR][COLOR="SeaGreen"])[/COLOR]
		doSendMagicEffect[COLOR="SeaGreen"]([/COLOR]{x[COLOR="SeaGreen"]=[/COLOR]1026,y[COLOR="SeaGreen"]=[/COLOR]400,z[COLOR="SeaGreen"]=[/COLOR]7}[COLOR="SeaGreen"],[/COLOR] 13[COLOR="SeaGreen"])[/COLOR]
	end
end[/COLOR]

In movements.xml set:

Code:
[COLOR="Navy"][COLOR="DarkGreen"]<[/COLOR]movevent event[COLOR="DarkGreen"]=[/COLOR][COLOR="Red"]"StepIn"[/COLOR] uniqueid[COLOR="DarkGreen"]=[/COLOR][COLOR="Red"]"2616"[/COLOR] script[COLOR="DarkGreen"]=[/COLOR][COLOR="Red"]"residence.lua"[/COLOR][COLOR="DarkGreen"]/>[/COLOR][/COLOR]
 
and its not my fault

1. I checked doSendMagicEffect({x=1026,y=400,z=7}, 13) (Correct)
2. I checked doPlayerSetTown(cid, 1) (Correct town ID on map)
3. I checked if item.uid == 2616 then (Correct on the teleport
 
If u are use TFS RC2 then put it in movements.xml
Code:
<movevent type="StepIn" itemid="1387" event="script" value="residence.lua"/>
If u are use another TFS then put it:
Code:
<movevent event="StepIn" itemid="1387" script="residence.lua"/>

I prefer action id in this script, so make actionid 9876 (delete unique) on teleport. After this put it in residence.lua
Code:
function onStepIn(cid, item, pos)
    if item.actionid == 9876 then
        doPlayerSetTown(cid, 1)
        doCreatureSay(cid,"Welcome to Hawai!", 21)
    end
return TRUE
end
 
Back
Top