What's new

-Skrypt Ksi??ka bles?w !

Status
Not open for further replies.

RoyPL

Advanced User
Joined
Apr 29, 2010
Messages
313
Reaction score
20
Nazwa i wersja silnika: TFS 0.2
Wersja klienta Tibii: 8.10
Opis:
Potrzebuje skryptu na książkę, kt?ra za darmo daje 5 BLESS?W !

( chodzi mi o skrypt w Actions ) !

Z g?ry dzięki !

Notka moderatorska:
Masz 1 dzień na uzupełnienie wzoru z regulaminu działu, inaczej temat trafi do kosza. Govern
 

Placek

Blue Waffle
Joined
Sep 30, 2008
Messages
6,793
Reaction score
672
Age
9
Odp: Ksi??ka bles?w !

PHP:
function onUse(cid, item, frompos, item2, topos)
doSendMagicEffect(topos,10) 
doRemoveItem(item.uid,1)
doPlayerAddBlessing(cid, 5)
end

PHP:
<action itemid="2297" script="bless.lua" />
 
Last edited:

RoyPL

Advanced User
Joined
Apr 29, 2010
Messages
313
Reaction score
20
Odp: Ksi??ka bles?w !

@up
No wszystko okej nie ma b??d?w, lecz da si? to naciska? ca?y czas niestety ..

Mo?e kto? mi przerobi? ten skrypt :

Code:
function onUse(cid, item, frompos, item2, topos)
doSendMagicEffect(topos,49) 
doPlayerAddBlessing(cid, 5)
if(getPlayerBlessing(cid, bless[i])) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought all blessing.")
doSendMagicEffect(getPlayerPosition(cid), 49)
doPlayerSendCancel(cid, "You have already all blessings.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
return TRUE
end
end

A w silniku wyskakuje mi taki b??d :

Code:
[08/11/2011  16:42:01] Warning: [Event::loadScript] Can not load script. data/actions/scripts/bless.lua
[08/11/2011  16:42:01] data/actions/scripts/bless.lua:12: '<eof>' expected near 'end'
 

Placek

Blue Waffle
Joined
Sep 30, 2008
Messages
6,793
Reaction score
672
Age
9
Odp: Ksi??ka bles?w !

Wywal ostania linijke(end).
Masz jedno if i jedno return na koncu.
Czyli maja byc 2 endy.
U ciebie sa 3.
 

RoyPL

Advanced User
Joined
Apr 29, 2010
Messages
313
Reaction score
20
Odp: Ksi??ka bles?w !

Po usuni?ciu end wychodzi mi takie co? przy klikaniu na item :

Code:
[08/11/2011  22:09:22] Lua Script Error: [Action Interface] 
[08/11/2011  22:09:22] data/actions/scripts/bless.lua:onUse

[08/11/2011  22:09:22] data/actions/scripts/bless.lua:4: attempt to index global 'bless' (a nil value)
 

Idk

Senior User
Joined
Aug 5, 2009
Messages
546
Reaction score
68
Age
29
Odp: Ksi??ka bles?w !

PHP:
for i = 1, 5 do
--linijka w kt?rej masz b??d
end
 

RoyPL

Advanced User
Joined
Apr 29, 2010
Messages
313
Reaction score
20
Odp: Ksi??ka bles?w !

a da? by kto? rade to napisa? ??!?! :
- Bless book -
* nie ko?cz?cy si?
* daje 5 blessow za darmo
* jak ju? mamy blessy to dostaje informacje o tym
 

RoyPL

Advanced User
Joined
Apr 29, 2010
Messages
313
Reaction score
20
Odp: Ksi??ka bles?w !

@REFRESH
Nikt nie da rady tego napisa? ?!! ?
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Ksi??ka bles?w !

Ech.
PHP:
local function getPlayerBlessCount(cid)
local p = 0
for i = 1, 5 do
	p = p + (getPlayerBlessing(cid, i) and 1 or 0)
end
return p
end

function onUse(cid, item, frompos, item2, topos)
if getPlayerBlessCount(cid) < 5 then
	for i = 1, 5 do
		doPlayerAddBlessing(cid, i)
	end
	return doSendMagicEffect(topos, CONST_ME_HOLYAREA) and doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have bought all blessing.')
end
return doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) and doPlayerSendCancel(cid, 'You have already all blessings.')
end
 

RoyPL

Advanced User
Joined
Apr 29, 2010
Messages
313
Reaction score
20
Odp: Ksi??ka bles?w !

Dzi?ki wielkie wszystko all ?miga .. : D !!

Zero b??d?w :D Daje REP + : D

Prosz? o zamkni?cie tematu !
 
Status
Not open for further replies.
Top