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

Talkaction bug

TKO

Syphero Owner!
Joined
Mar 10, 2008
Messages
2,252
Reaction score
27
Location
Sweden
hey i tryd to add a script for my server that can teleport you when you stand on a sirten position
i have added the cord in my script still dont work.. i got this errors!
Code:
[20/07/2009 18:15:03] Warning: [Event::checkScript] Can not load script. /scripts/admin tko tp.lua
[20/07/2009 18:15:03] data/talkactions/scripts/admin tko tp.lua:3: '}' expected near '='

added in talaction.xml
Code:
        <talkaction words="admin tko" script="admin tko tp.lua" />


Code:
function onSay(cid, words, param, channel)
	local config = {
		reqPos = {x=,y=,z=},
		newPos = {x=,y=,z=},
		someWhereElse = {x=,y=,z=}
	}

	if (getCreaturePosition(cid) == config.reqPos) then
		doTeleportThing(cid, config.newPos)
	else
		doTeleportThing(cid, config.someWhereElse)
	end

	return TRUE
end
 
lol, try to put

LUA:
function onSay(cid, words, param, channel)
	local config = {
		reqPos = { x=100, y=100, z=7 },
		newPos = { x=200, y=200, z=7 },
		someWhereElse = { x=300, y=300, z=300 }
	}

	if (getCreaturePosition(cid) == config.reqPos) then
		doTeleportThing(cid, config.newPos)
	else
		doTeleportThing(cid, config.someWhereElse)
	end

	return TRUE
end

You haven't set any Position to be Tp'd or w/e is that script for ;)
 
READ! lol

LUA:
		reqPos = { x = 100, y = 100, z = 7 },
		newPos = { x = 200, y = 200, z = 7 },
		someWhereElse = { x = 300, y = 300, z = 300 }

Don't do:

LUA:
		reqPos = { x=asd, y=asd, z=asd },
		newPos = { x=qwe, y=qwe, z=qwe },
		someWhereElse = { x=rty, y=rty, z=rty }

LUA:
 x=asd -- x = asd

You got it? :S
 
i have added the cord in my script still dont work.. i got this errors!
this is just for showing how it's build... omg
 
LUA:
function onSay(cid, words, param, channel)
	local config = {
		fromPos = { x = 100, y = 100, z = 7 },
		toPos = { x = 200, y = 200, z = 7 },
		elsePos = { x = 300, y = 300, z = 300 }
	}

	if (getCreaturePosition(cid) == config.fromPos) then
		doTeleportThing(cid, config.toPos)
	else
		doTeleportThing(cid, config.elsePos)
	end

	return TRUE
end

Try that if it works :S
 
You don't need the spaces in the code, compilers remove blank space from code when compiled so its just for looks.

I tested the code that Epic posted the first time --


LUA:
		reqPos = { x = 100, y = 100, z = 7 },
		newPos = { x = 200, y = 200, z = 7 },
		someWhereElse = { x = 300, y = 300, z = 300 }

Don't do:

LUA:
		reqPos = { x=asd, y=asd, z=asd },
		newPos = { x=qwe, y=qwe, z=qwe },
		someWhereElse = { x=rty, y=rty, z=rty }

LUA:
 x=asd -- x = asd

You got it? :S

Worked perfectly fine the first time I put it in, just add coords and away I went.
 
Back
Top