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

[REQUEST] Need Help With Animated Tiles :)

Heroid

Active Member
Joined
Mar 7, 2011
Messages
336
Solutions
13
Reaction score
36
Hello! :) :ninja:
I need help with this, Another guy helped me so i get all random magic effects on the tiles, But now i've seen some that i dont want... They look, UGLY! Heres my script atm...

local config = {
positions = {
["Welcome!"] = { x = 1105, y = 989, z = 7 },
["Hunting!"] = { x = 998, y = 990, z = 7 },
["Quests!"] = { x = 997, y = 990, z = 7 },
["Trainers!"] = { x = 991, y = 997, z = 7 },
["NTHN ATM!"] = { x = 991, y = 999, z = 7 },
["War!"] = { x = 994, y = 1005, z = 7 },
["POI!"] = { x = 990, y = 983, z = 7 },
["USE!"] = { x = 753, y = 888, z = 7 },
["Equipment!"] = { x = 991, y = 998, z = 7 },
["Events!"] = { x = 991, y = 996, z = 7 },
["Team I!"] = { x = 1087, y = 1215, z = 7 },
["Team II!"] = { x = 1094, y = 1215, z = 7 },
["Spectate!"] = { x = 1084, y = 1220, z = 7 },
["[Temple]"] = { x = 1104, y = 967, z = 7 },
["Rusty"] = { x = 1101, y = 965, z = 7 },
["Norseman"] = { x = 1107, y = 965, z = 7 },
["Warrior"] = { x = 1101, y = 956, z = 7 },
["Kings"] = { x = 1107, y = 956, z = 7 },
["Dragon"] = { x = 1101, y = 947, z = 7 },
["Guardian"] = { x = 1107, y = 947, z = 7 },
["Solar"] = { x = 1101, y = 938, z = 7 },
["Hell"] = { x = 1107, y = 938, z = 7 },
["Sparking"] = { x = 1101, y = 929, z = 7 },
["Earth"] = { x = 1107, y = 929, z = 7 },
["Storm"] = { x = 1101, y = 920, z = 7 },
["Flaming"] = { x = 1107, y = 920, z = 7 },
["Archmage"] = { x = 1101, y = 911, z = 7 },
["Pirate"] = { x = 1107, y = 911, z = 7 },
["*EPIC !*"] = { x = 1101, y = 902, z = 7 },
["Donation!"] = { x = 1107, y = 902, z = 7 },
["[Temple]"] = { x = 1097, y = 1229, z = 7 },
["[Temple]"] = { x = 1025, y = 993, z = 7 },
["*Items*"] = { x = 999, y = 990, z = 7 },

},
}


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



And, The thing is, I DO NOT WANT THE Effects With IDs: 33, 55, 56, 57, 58, 59, 60 and 67. All Else I Want... And Its The Effects Here [ doSendMagicEffect(pos, math.random(66))]... That Im Talking About, I think u knew that but i dont want any wrongs, Ty ...
 
LUA:
local positions, effect = {
	["Welcome!"] = { x = 1105, y = 989, z = 7 },
	["Hunting!"] = { x = 998, y = 990, z = 7 },
	["Quests!"] = { x = 997, y = 990, z = 7 },
	["Trainers!"] = { x = 991, y = 997, z = 7 },
	["NTHN ATM!"] = { x = 991, y = 999, z = 7 },
	["War!"] = { x = 994, y = 1005, z = 7 },
	["POI!"] = { x = 990, y = 983, z = 7 },
	["USE!"] = { x = 753, y = 888, z = 7 },
	["Equipment!"] = { x = 991, y = 998, z = 7 },
	["Events!"] = { x = 991, y = 996, z = 7 },
	["Team I!"] = { x = 1087, y = 1215, z = 7 },
	["Team II!"] = { x = 1094, y = 1215, z = 7 },
	["Spectate!"] = { x = 1084, y = 1220, z = 7 },
	["[Temple]"] = { x = 1104, y = 967, z = 7 },
	["Rusty"] = { x = 1101, y = 965, z = 7 },
	["Norseman"] = { x = 1107, y = 965, z = 7 },
	["Warrior"] = { x = 1101, y = 956, z = 7 },
	["Kings"] = { x = 1107, y = 956, z = 7 },
	["Dragon"] = { x = 1101, y = 947, z = 7 },
	["Guardian"] = { x = 1107, y = 947, z = 7 },
	["Solar"] = { x = 1101, y = 938, z = 7 },
	["Hell"] = { x = 1107, y = 938, z = 7 },
	["Sparking"] = { x = 1101, y = 929, z = 7 },
	["Earth"] = { x = 1107, y = 929, z = 7 },
	["Storm"] = { x = 1101, y = 920, z = 7 },
	["Flaming"] = { x = 1107, y = 920, z = 7 },
	["Archmage"] = { x = 1101, y = 911, z = 7 },
	["Pirate"] = { x = 1107, y = 911, z = 7 },
	["*EPIC !*"] = { x = 1101, y = 902, z = 7 },
	["Donation!"] = { x = 1107, y = 902, z = 7 },
	["[Temple]"] = { x = 1097, y = 1229, z = 7 },
	["[Temple]"] = { x = 1025, y = 993, z = 7 },
	["*Items*"] = { x = 999, y = 990, z = 7 }
}, {}

local notAllowedEffects = {33, 55, 56, 57, 58, 59, 60, 67}

function onThink(cid, interval, lastExecution)
	for i = 1, 67 do
		for _, v in ipairs(notAllowedEffects) do
			if i ~= v then
				table.insert(effect, i)
			end
		end
	end	
	
	for text, pos in pairs(config.positions) do
		doSendMagicEffect(pos, effect[math.random(#effect)])
		doSendAnimatedText(pos, text, math.random(255))
	end
	return TRUE
end
 
Last edited:
Didn't Worked, Sorry, I Got This In My Console, But Thanks You Anyway, And Please Any1 Try Again... ;) <33

[26/04/2011 20:00:10] [Error - GlobalEvent Interface]
[26/04/2011 20:00:10] data/globalevents/scripts/effects.lua:onThink
[26/04/2011 20:00:10] Description:
[26/04/2011 20:00:10] data/globalevents/scripts/effects.lua:47: attempt to index global 'config' (a nil value)
[26/04/2011 20:00:10] stack traceback:
[26/04/2011 20:00:10] data/globalevents/scripts/effects.lua:47: in function <data/globalevents/scripts/effects.lua:38>
[26/04/2011 20:00:10] [Error - GlobalEvents::think] Couldn't execute event: effects
 
Did Not Worked, My Script ATM...

local positions, effect = {
["Welcome!"] = { x = 1105, y = 989, z = 7 },
["Hunting!"] = { x = 998, y = 990, z = 7 },
["Quests!"] = { x = 997, y = 990, z = 7 },
["Trainers!"] = { x = 991, y = 997, z = 7 },
["NTHN ATM!"] = { x = 991, y = 999, z = 7 },
["War!"] = { x = 994, y = 1005, z = 7 },
["USE!"] = { x = 753, y = 888, z = 7 },
["Equipment"] = { x = 991, y = 998, z = 7 },
["Events!"] = { x = 991, y = 996, z = 7 },
["Team I!"] = { x = 1087, y = 1215, z = 7 },
["Team II!"] = { x = 1094, y = 1215, z = 7 },
["Spectate!"] = { x = 1084, y = 1220, z = 7 },
["[Temple]"] = { x = 1104, y = 967, z = 7 },
["Rusty"] = { x = 1101, y = 965, z = 7 },
["Norseman"] = { x = 1107, y = 965, z = 7 },
["Warrior"] = { x = 1101, y = 956, z = 7 },
["Kings"] = { x = 1107, y = 956, z = 7 },
["Dragon"] = { x = 1101, y = 947, z = 7 },
["Guardian"] = { x = 1107, y = 947, z = 7 },
["Solar"] = { x = 1101, y = 938, z = 7 },
["Hell"] = { x = 1107, y = 938, z = 7 },
["Sparking"] = { x = 1101, y = 929, z = 7 },
["Earth"] = { x = 1107, y = 929, z = 7 },
["Storm"] = { x = 1101, y = 920, z = 7 },
["Flaming"] = { x = 1107, y = 920, z = 7 },
["Archmage"] = { x = 1101, y = 911, z = 7 },
["Pirate"] = { x = 1107, y = 911, z = 7 },
["*EPIC !*"] = { x = 1101, y = 902, z = 7 },
["Donation!"] = { x = 1107, y = 902, z = 7 },
["[Temple]"] = { x = 1097, y = 1229, z = 7 },
["[Temple]"] = { x = 1025, y = 993, z = 7 },
["*Items*"] = { x = 999, y = 990, z = 7 }
},{}

local notAllowedEffects = {33, 55, 56, 57, 58, 59, 60, 67}

function onThink(cid, interval, lastExecution)
for i = 1, 67 do
for _, v in ipairs(notAllowedEffects) do
if i ~= v then
table.insert(effect, i)
end
end
end

for text, pos in pairs(positions) do
doSendMagicEffect(pos, effect[math.random(#effect)])
doSendAnimatedText(pos, text, math.random(255))
end
return TRUE
end

Problem is stuffs with IDs 33 and that are still being showed... And another question how to copy in a lua code like VirrageS did before? Thanks ;)
 
Just Some1 Please Help Me? o.O
And it says my temple position is wrong, I dunno, But its not my account manager, I can login to that 1 but when i die on a normal char and try to login it says "Temple position is wrong. Please contact the administrator."... Help me With that 2 Please ;)...
 
#up.
Create another topic for your problem.
but.
is like this, open your map, check "ctrl + t", then add temple position of a city.
open config.lua...
LUA:
	newPlayerSpawnPosX = templeX
	newPlayerSpawnPosY = templeY
	newPlayerSpawnPosZ = templeZ
	newPlayerTownId = templeID
Temple id you got in ctrl+t on rme.. :)
 
LUA:
local positions, effect = {
	["Welcome!"] = { x = 95, y = 110, z = 7 },
	["Hunting!"] = { x = 96, y = 120, z = 7 },
	["Quests!"] = { x = 94, y = 120, z = 7 },
	["Trainers!"] = { x = 94, y = 121, z = 7 },
	["NTHN ATM!"] = { x = 94, y = 122, z = 7 },
	["War!"] = { x = 994, y = 1005, z = 7 },
	["POI!"] = { x = 990, y = 983, z = 7 },
	["USE!"] = { x = 753, y = 888, z = 7 },
	["Equipment!"] = { x = 991, y = 998, z = 7 },
	["Events!"] = { x = 991, y = 996, z = 7 },
	["Team I!"] = { x = 1087, y = 1215, z = 7 },
	["Team II!"] = { x = 1094, y = 1215, z = 7 },
	["Spectate!"] = { x = 1084, y = 1220, z = 7 },
	["[Temple]"] = { x = 1104, y = 967, z = 7 },
	["Rusty"] = { x = 1101, y = 965, z = 7 },
	["Norseman"] = { x = 1107, y = 965, z = 7 },
	["Warrior"] = { x = 1101, y = 956, z = 7 },
	["Kings"] = { x = 1107, y = 956, z = 7 },
	["Dragon"] = { x = 1101, y = 947, z = 7 },
	["Guardian"] = { x = 1107, y = 947, z = 7 },
	["Solar"] = { x = 1101, y = 938, z = 7 },
	["Hell"] = { x = 1107, y = 938, z = 7 },
	["Sparking"] = { x = 1101, y = 929, z = 7 },
	["Earth"] = { x = 1107, y = 929, z = 7 },
	["Storm"] = { x = 1101, y = 920, z = 7 },
	["Flaming"] = { x = 1107, y = 920, z = 7 },
	["Archmage"] = { x = 1101, y = 911, z = 7 },
	["Pirate"] = { x = 1107, y = 911, z = 7 },
	["*EPIC !*"] = { x = 1101, y = 902, z = 7 },
	["Donation!"] = { x = 1107, y = 902, z = 7 },
	["[Temple]"] = { x = 1097, y = 1229, z = 7 },
	["[Temple]"] = { x = 1025, y = 993, z = 7 },
	["*Items*"] = { x = 999, y = 990, z = 7 }
}, {}
 
local notAllowedEffects = {33, 55, 56, 57, 58, 59, 60, 67}
 
function onThink(interval)
	for i = 1, 67 do
		x = 0
		for _, v in ipairs(notAllowedEffects) do
			if i == v then
				table.remove(notAllowedEffects, _)
				break
			else
				if x ~= 1 then
					table.insert(effect, i)
					x = 1
				end
			end
		end
	end
	
	for text, pos in pairs(positions) do
		doSendMagicEffect(pos, effect[math.random(#effect)])
		doSendAnimatedText(pos, text, math.random(255))
	end
	return TRUE
end
 
Thanks VirrageS The Scipt Worked Excellent! And Also Thanks DukeeH, It also worked, Love you guys! :D <33
 
First of all Your coding.

code-tagging at OTland

Code:
HTML Code:
 html code [.html]code[./html]XML Code:
 xml code [.xml]code[./xml]PHP Code:
 PHP code [.php]code[./php]  
Lua Code:
 lua code [.lua]code[./lua]SQL Code:
 SQL code [.SQL]code[./SQL]C Code:
 c++ code [.cpp]code[./cpp]Code:
 code code (used for anything that doesn't fit) [.code]code[./code]

[.code]

HTML Code:
html code [.html]code[./html]XML Code:
xml code [.xml]code[./xml]PHP Code:
PHP code [.php]code[./php]
Lua Code:
lua code [.lua]code[./lua]SQL Code:
SQL code [.SQL]code[./SQL]C Code:
c++ code [.cpp]code[./cpp]Code:
code code (used for anything that doesn't fit) [.code]code[./code]

[./code]

Remove the . dot
V
[.code]
Yourcode
[./code]
 
Back
Top