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

Scrypt Help

xanter1123

New Member
Joined
Jan 23, 2009
Messages
13
Reaction score
1
Witam, mam problem
napisalem prosty skrypt ktory dziala nie w ta strone co chcialbym :/.
Code:
function onUse(cid, item, position, fromPosition)
local storageValue = 1500
status = getPlayerStorageValue(cid,storageValue)

	if (item.uid == 44444) and (status >1) and (status <1) == TRUE then

		doTeleportThing(cid, fromPosition, FALSE)		
	end
	return TRUE
end
Chcialem by teleportowal na "x" wtedy kiedy postac NIE MA wpisane Value.
A wychodzi, ze gdy MA to teleportuje.
czytalem poradniki i znalazlem "!=" lecz wyskakuje mi blad
Code:
[06/06/2009 13:55:01] Warning: [Event::loadScript] Can not load script. data/actions/scripts/quests/prøve.lua
[06/06/2009 13:55:01] data/actions/scripts/quests/prøve.lua:5: ')' expected near '!'
 
Last edited:
Lua:
local storage = 1500
function onUse(cid, item, position, fromPosition)
	if item.uid == 44444 and getPlayerStorageValue(cid,storage) >= 0 then
		doTeleportThing(cid, fromPosition, FALSE)		
	end
	return TRUE
end
Nie równa się to ~= :)
 
Podmienilem/zmienilem.
bledow nie ma, ale teraz to wszyscy moga wejsc czy maja czy tez nie maja.
 
Last edited:
Fakt, zapomniałem...
Lua:
local storage = 1500
function onUse(cid, item, position, fromPosition)
	if item.uid == 44444 and getPlayerStorageValue(cid,storage) <= 0 then
		setPlayerStorageValue(cid, storage, 1)
		doTeleportThing(cid, fromPosition, FALSE)		
	end
	return TRUE
end
 
Last edited:
Nadal nie dziala :/. Jest tak samo jak bylo :/.
Przeczytalem juz wszystkie poradniki, no i nie moge znalezc nic pomocnego w tym xD.
@edit
local storage = 1500
Czy to czasem nie jest storage podane ? ...
-.-
 
Last edited:
if item.uid == 44444 and getPlayerStorageValue(cid,storage) == 0 then

takie cos nie podziala? skoro, ma teleportowac jak nie ma storage
 
Nadal nie dziala :/. Jest tak samo jak bylo :/.
Przeczytalem juz wszystkie poradniki, no i nie moge znalezc nic pomocnego w tym xD.
@edit
local storage = 1500
Czy to czasem nie jest storage podane ? ...
-.-
Numer pola w tabeli storage, nie rozumiem o co ten bulwers o_O
Lua:
local storage = 1500
function onUse(cid, item, position, fromPosition)
	if item.uid == 44444 and getPlayerStorageValue(cid,storage) < 0 then
		setPlayerStorageValue(cid, storage, 1)
		doTeleportThing(cid, fromPosition, FALSE)		
	end
	return TRUE
end

if item.uid == 44444 and getPlayerStorageValue(cid,storage) == 0 then

takie cos nie podziala? skoro, ma teleportowac jak nie ma storage
Storage może przyjąć wartość 0, brak danego pola jest oznaczany -1.

## Porady dla początkujących skrypterów:
1. Myślcie przy pisaniu o każdej możliwości, zastanówcie się nad każdym krokiem działania skryptu,
2. sprawdzajcie skrypty przed wklejeniem, nie powielajcie mojego błędu :D
 
@up
no tez nie działa, ale wpadłem na pomysł by dać to do movements(Tak zacytuje Ciebie :)
## Porady dla początkujących skrypterów:
1. Myślcie przy pisaniu o każdej możliwości, zastanówcie się nad każdym krokiem działania skryptu,
2. sprawdzajcie skrypty przed wklejeniem, nie powielajcie mojego błędu
. Ten pierwszy pomogl mi bardzo :p)

Code:
local storage = 1500
function onStepIn(cid, item, position, fromPosition)
        if item.uid == 44444 and getPlayerStorageValue(cid,storage) < 0 then
                setPlayerStorageValue(cid, storage, 1)
                doTeleportThing(cid, fromPosition, FALSE)              
        end
        return TRUE
end
I fakt, pierwszy raz teleportowało, a drugi juz nie, bo dzięki
Code:
setPlayerStorageValue(cid, storage, 1)
storage zostawało dodawane. Usunąwszy to śmiga jak ta lala. Dziękuje :)
 
Last edited:
Back
Top