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

Can somebody check this script?

Winnerandy

Experienced Web Design'er
Joined
Oct 23, 2008
Messages
2,251
Reaction score
51
Location
Tellus.
Okay, I got this error in console:

[ERROR - LuaScript Inteface::loadfile] data/globalevents/scripts/teleporttext.lua:5: ´}´ expected <to close at line 2> near ´[´

[WARNING - Event::LoadScript] Cannot load script <data/globalevents/scripts/teleporttext.lua>data/globalevents/scripts/teleporttext.lua:´}´ expected <to close ´{´ at line 2> near ´[´




1.local config = {
2. positions = {
3. ["Promotion Seller"] = { x = 151, y = 45, z = 7 },
4. ["Trainers"] = { x = 152, y = 45, z = 7 }
5. ["Addon Seller"] = { x = 154, y = 45, z = 7 }
6. ["Teleports"] = { x = 153, y = 45, z = 7 }
7. }
8.}
9.
10.function onThink(cid, interval, lastExecution)
11. for text, pos in pairs(config.positions) do
12. doSendAnimatedText(pos, text, math.random(1, 255))
13. end
14.
15. return TRUE
16.end
Can somebody fix it :D

REP++
 
Code:
local config = {
	["Promotion Seller"] = {x = 151, y = 45, z = 7},
	["Trainers"] = {x = 152, y = 45, z = 7},
	["Addon Seller"] = {x = 154, y = 45, z = 7},
	["Teleports"] = {x = 153, y = 45, z = 7}
}
function onThink(cid, interval, lastExecution)
	for text, pos in ipairs(config) do
		doSendAnimatedText(pos, text, math.random(215))
	end
	return TRUE
end
 
You can use max 2 positions in 1 script. So you have to create 2 scripts:
teleporttext.lua
local config = {
positions = {
["Promotion Seller"] = { x = 151, y = 45, z = 7 },
["Trainers"] = { x = 152, y = 45, z = 7 }
}
}

function onThink(cid, interval, lastExecution)
for text, pos in pairs(config.positions) do
doSendAnimatedText(pos, text, math.random(1, 255))
end
return TRUE
end
teleporttext2
local config = {
positions = {
["Addon Seller"] = { x = 154, y = 45, z = 7 }
["Teleports"] = { x = 153, y = 45, z = 7 }
}
}

function onThink(cid, interval, lastExecution)
for text, pos in pairs(config.positions) do
doSendAnimatedText(pos, text, math.random(1, 255))
end
return TRUE
end

Add to globalevents.xml
<globalevent name="teleporttext" interval="2" event="script" value="teleporttext.lua"/>
<globalevent name="teleporttext2" interval="1" event="script" value="teleporttext2.lua"/>

Rep if it helped.

Cykotitan was first and he's got better script i think.
 
Back
Top