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

Floor Giving Mana\HP

troxet

New Member
Joined
Oct 7, 2010
Messages
158
Reaction score
3
Location
United kingdom
Hello, Im Writing this Treat because i need Help!

What i mean is That On Some OTS ive seen Something Like a Floor that Heals You Fully

Its 9 Squares

And it Has got Effect On it

Normally is Seeable in Temple When you Spawn

I Would be Very Pleased If somebody could find me or Write one of those scripts :)
 
How about you write it yourself?
Believe it or not, 3 lines of script are necessary for such thing to be made.

Steps:
1. Use the search option
2. Find a LUA tutorial
3. Get to know the very of very basics
4. Make this script in 30 seconds

Go.
 
ill write it But i cant find any tutorials on such a thing :/

- - - Updated - - -

I Wanted it so Its a Magic Effect on Certain Tile and When person Walks on it It Gives them Health and Mana !

Just tell me Where to Do it ? - Movements, Talkaction, Action, Or where ??
 
You will need 2 things for that.
First of all, you will need a globalevent which will upon execution, show an effect (doSendMagicEffect(pos,#)) on your desired position(s). And you just set a delay of few seconds between its executions in globalevents.xml

Then, you make a movement script that will add HP & Mana when a player steps on it.
That means a onStepIn script with doCreatureAddHealth(cid, amount) and doCreatureAddMana(cid, amount).

Also excuse me for not helping you directly, but I think it shouldn't bother you if you are willing to learn. c:

If you need to learn basics of LUA (the easiest possible stuff), check this thread. I personally learned by reading other people's scripts, the simple ones.
Also, a list of all commands and functions available for your TFS can be found on the location serverfolder/doc/LUA_FUNCTIONS.

Hope this helps.
 
i will Join the Conversation Too Because i need Something similar to it - But the Bad
Think is that im bad at Scripting Movements...

It Looks like this :


[video=youtube;K3f0JWeVBs8]http://www.youtube.com/watch?v=K3f0JWeVBs8[/video]


On the Beggining of the Wideo !
Red Effect

Please but Please i really Neeed It :/

and Rep++ for Somebodys help !:)
 
global events

Lua:
local positions = {
	{x = 1000, y = 1000, z = 7},
	{x = 1000, y = 1000, z = 7},
	{x = 1000, y = 1000, z = 7},
	{x = 1000, y = 1000, z = 7},
	{x = 1000, y = 1000, z = 7},
	{x = 1000, y = 1000, z = 7}
}

function onThink(cid, interval, lastExecution)
	for _, effects in ipairs(positions) do
		doSendMagicEffect(effects, CONST_ME_FIREWORK_RED)
	end
	return true
end

movements

Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if isPlayer(cid) then
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
		doCreatureAddMana(cid, getCreatureMaxMana(cid))
	end
	return true
end

not tested
 
Last edited:
Synthetic Your one Doesnt work But...

Ive scripped that Last night ==


PHP:
local positions = {
{ x = 875, y = 1024, z = 7},
{ x = 876, y = 1024, z = 7},
{ x = 877, y = 1024, z = 7},
{ x = 875, y = 1025, z = 7},
{ x = 876, y = 1025, z = 7},
{ x = 877, y = 1025, z = 7},
{ x = 875, y = 1026, z = 7},
{ x = 876, y = 1026, z = 7},
{ x = 877, y = 1026, z = 7}
}
function onThink(cid, interval, lastExecution)
for _, pos in ipairs(positions) do
pl = getTopCreature(pos)
doSendMagicEffect(pos, 28)
if pl.itemid == 1 then
doCreatureAddHealth(pl.uid, math.random(999999999,999999999))
doCreatureAddMana(pl.uid, math.random(999999999,999999999))
end
end
return TRUE
end

But Can somebody edit it for me So it will show how much Mana it gives to a certain player ?

REP ++ For Help
 
Synthetic Your one Doesnt work But...

Ive scripped that Last night ==


PHP:
local positions = {
{ x = 875, y = 1024, z = 7},
{ x = 876, y = 1024, z = 7},
{ x = 877, y = 1024, z = 7},
{ x = 875, y = 1025, z = 7},
{ x = 876, y = 1025, z = 7},
{ x = 877, y = 1025, z = 7},
{ x = 875, y = 1026, z = 7},
{ x = 876, y = 1026, z = 7},
{ x = 877, y = 1026, z = 7}
}
function onThink(cid, interval, lastExecution)
for _, pos in ipairs(positions) do
pl = getTopCreature(pos)
doSendMagicEffect(pos, 28)
if pl.itemid == 1 then
doCreatureAddHealth(pl.uid, math.random(999999999,999999999))
doCreatureAddMana(pl.uid, math.random(999999999,999999999))
end
end
return TRUE
end

But Can somebody edit it for me So it will show how much Mana it gives to a certain player ?

REP ++ For Help

The first script is for effect on the floor, and the second script is for heal life and mana.

You know as put in the creaturescript.xml and movements.xml???

And for the positions I can help you. try in the first

Lua:
local positions = {
	{x = 875, y = 1024, z = 7},
	{x = 876, y = 1024, z = 7},
	{x = 877, y = 1024, z = 7},
	{x = 875, y = 1025, z = 7},
	{x = 876, y = 1025, z = 7},
	{x = 877, y = 1025, z = 7},
	{x = 875, y = 1026, z = 7},
	{x = 876, y = 1026, z = 7},
	{x = 8770, y = 1026, z = 7}
}
 
function onThink(cid, interval, lastExecution)
	for effects in ipairs(positions) do
		doSendMagicEffect(effects, CONST_ME_FIREWORK_RED)
	end
	return true
end
 
Noo i dont Really know an I would be very pleased If you could Help ME :)

- - - Updated - - -

Ive dont Globalevents Like you Said and i Get this Error :/

PHP:
[Error - GlobalEvent Interface]
data/globalevents/scripts/talki.lua:onThink
Description:
attempt to index a number value
stack traceback:
        [C]: in function 'doSendMagicEffect'
        data/globalevents/scripts/talki.lua:15: in function <data/globalevents/s
cripts/talki.lua:13>
[Error - GlobalEvents::think] Couldn't execute event: talki


Stil Rep++ For person that Will sort this S*** Out :)
 
Back
Top