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

help with my first scrpit

healer007

New Member
Joined
Nov 11, 2008
Messages
174
Reaction score
0
Location
doesnt matter
HTML:
playerpos = getPlayerPosition(cid) 
newpos =={x=348, y=441, z=8}
 
if item.actionid = 3232 then
 
getThingfromPos(playerpos) 
doSendMagicEffect(playerpos,2) 
doTeleportThing(cid,novapos) 
doSendMagicEffect(novapos,10) 
end 
returen 1
end

This is my first scrpit it should work like this> Step on a tile with (....)action id and you get teleported somewhere.
I doesnt work i get errors
Can anyone help me out
 
Code:
function onStepIn(cid, item)
	local playerPos = getPlayerPosition(cid) 
	local newPos = { x = 348, y = 441, z = 8 }
	 
	if item.actionid = 3232 then 
		doSendMagicEffect(playerPos, 2) 
		doTeleportThing(cid, newPos, TRUE)
		doSendMagicEffect(newPos, 10) 
	end 
	return TRUE
end

returen? maybe talaturen? 0j0j00j0j

@Down, well, yeah 8D
 
Last edited:
so it should be something like this?

Code:
function onStepIn(cid, item)
	local playerPos = getPlayerPosition(cid) 
	local newPos = { x = 348, y = 441, z = 8 }
	 
	if item.actionid = 3232 then 
		doTeleportThing(cid, newPos, TRUE) 
		ddoSendMagicEffect(playerPos, 2)
		doSendMagicEffect(newPos, 10) 
	end 
	return TRUE
end

doesnt work tho
[01/02/2009 10:37:14] Warning: [Event::loadScript] Can not load script. data/movements/scripts/tilepoi1.lua
[01/02/2009 10:37:14] data/movements/scripts/tilepoi1.lua:5: 'then' expected near '='
 
aff tryed it looking like this


Code:
function onStepIn(cid, item)
	local playerPos = getPlayerPosition(cid) 
	local newPos = {x=48,y=441,z=8}
	 
	if item.actionid == 3232 then 
		doTeleportThing(cid, newPos, TRUE) 
		ddoSendMagicEffect(playerPos, 2)
		doSendMagicEffect(newPos, 10) 
	end 
	return TRUE
end

and i get this

[01/02/2009 11:06:15] Warning: [Event::loadScript] Can not load script. data/movements/scripts/tilepoi1.lua
[01/02/2009 11:06:15] data/movements/scripts/tilepoi1.lua:66: unexpected symbol near '{'
 
There's the script that i made

Code:
function onStepIn(cid, item, position, fromPosition, pos)
telepos = {x=348, y=441, z=8}
        if  item.actionid == 3232 then   
        doTeleportThing(cid, telepos, TRUE) 
        doSendMagicEffect(newpos, 2)
end
return TRUE
end

Doesnt work can u fix it ore make me a new one?
thnx
 
You are not declaring "newpos" try this:

PHP:
function onStepIn(cid, item, position, fromPosition, pos)
telepos = {x=348, y=441, z=8}
newpos = {x=348, y=441, z=8}
        if item.actionid == 3232 then   
        doTeleportThing(cid, telepos, TRUE) 
        doSendMagicEffect(newpos, 2)
end
return TRUE
end
 
You are not declaring "newpos" try this:

PHP:
function onStepIn(cid, item, position, fromPosition, pos)
telepos = {x=348, y=441, z=8}
newpos = {x=348, y=441, z=8}
        if item.actionid == 3232 then   
        doTeleportThing(cid, telepos, TRUE) 
        doSendMagicEffect(newpos, 2)
end
return TRUE
end



why even writing if item.actionid? just start with doTeleportThing cuz actionid = actions.xml:) easier.
 
@ooh:p?
I forget it was on StepIn.
But you can use uniqueid on movements.xml:)

Actionid works as well, but you said actions.xml and not movements.xml

Also it's spelled movements but Rudolf Czarodziej fail in english :(
 
Last edited:
Back
Top