Apoccalypse
New Member
- Joined
- Apr 15, 2017
- Messages
- 114
- Solutions
- 2
- Reaction score
- 4
I have a problem with my two scripts.
The first one is a classic Pits of Inferno script which should allow a player to get pass a door when he stands at all of the six thrones.
where
10281 -----> my door uniqueid
10001-10007 (witout 10006) ----> my thrones uniqueid
I stand at least 3 times at every throne but every time when I want to get pass by the door I get the message "Sorry, you did not stand at every throne!".
I have another script but the problem is the same.
I have complatly no idea why it is not working.
-----------------------------------------------------------------------------------------------------------------
And my another problem with a switch.
I want to remove a fire wall after a player will switch a switch.
Here is a script:
where
x=477, y=1275, z=10 ----> it is the position of my switch
1945 - id of the witch
12304 - uniqueid of the switch
5062 - id of the fire wall
That freaking me out because that script is a copy of it below and that below works and that above does not.I constantly get a massage "Sorry, not possible"
If anyone could help that would be great
The first one is a classic Pits of Inferno script which should allow a player to get pass a door when he stands at all of the six thrones.
<action uniqueid="10281" script="Poi/poi_last.lua"/>
function onUse(cid, item, fromPosition, itemEx, toPosition)
local charpos = getPlayerPosition(cid)
if item.uid == 10281 and charpos.x == 482 and (charpos.y == 1187 or charpos.y == 1418) and charpos.z == 12 then
if getPlayerStorageValue(cid,10005) == -1 or getPlayerStorageValue(cid,10001) == -1 or getPlayerStorageValue(cid,10002) == -1 or getPlayerStorageValue(cid,10003) == -1 or getPlayerStorageValue(cid,10004) == -1 or getPlayerStorageValue(cid,10007) == -1 then doPlayerSendTextMessage(cid,25,'Sorry, you did not stand at every throne!!')
else local newPos = {x=482, y=1185, z=12}
doTeleportThing(cid, newPos)
doSendMagicEffect(newPos, 10) end
elseif item.uid == 10281 and charpos.x == 482 and (charpos.y == 1185 or charpos.y == 1420) and charpos.z == 12 then
local newPos = {x=482, y=1187, z=12}
doSendMagicEffect(getPlayerPosition(cid), 2)
doTeleportThing(cid, newPos)
doSendMagicEffect({x=482, y=1187, z=12}, 10) end return 1 end"]
local charpos = getPlayerPosition(cid)
if item.uid == 10281 and charpos.x == 482 and (charpos.y == 1187 or charpos.y == 1418) and charpos.z == 12 then
if getPlayerStorageValue(cid,10005) == -1 or getPlayerStorageValue(cid,10001) == -1 or getPlayerStorageValue(cid,10002) == -1 or getPlayerStorageValue(cid,10003) == -1 or getPlayerStorageValue(cid,10004) == -1 or getPlayerStorageValue(cid,10007) == -1 then doPlayerSendTextMessage(cid,25,'Sorry, you did not stand at every throne!!')
else local newPos = {x=482, y=1185, z=12}
doTeleportThing(cid, newPos)
doSendMagicEffect(newPos, 10) end
elseif item.uid == 10281 and charpos.x == 482 and (charpos.y == 1185 or charpos.y == 1420) and charpos.z == 12 then
local newPos = {x=482, y=1187, z=12}
doSendMagicEffect(getPlayerPosition(cid), 2)
doTeleportThing(cid, newPos)
doSendMagicEffect({x=482, y=1187, z=12}, 10) end return 1 end"]
where
10281 -----> my door uniqueid
10001-10007 (witout 10006) ----> my thrones uniqueid
I stand at least 3 times at every throne but every time when I want to get pass by the door I get the message "Sorry, you did not stand at every throne!".
I have another script but the problem is the same.
function onUse(cid, item, frompos, item2, topos) if item.uid == 10281 then
queststatus = getPlayerStorageValue(cid,10005) .
queststatus = getPlayerStorageValue(cid,10001) -- Quest number that needs to be COMPLETE.
queststatus = getPlayerStorageValue(cid,10002) -- Quest number that needs to be COMPLETE.
queststatus = getPlayerStorageValue(cid,10007) -- Quest number that needs to be COMPLETE.
queststatus = getPlayerStorageValue(cid,10003) -- Quest number that needs to be COMPLETE.
queststatus = getPlayerStorageValue(cid,10004) -- Quest number that needs to be COMPLETE.
area = {x=482, y=1185, z=12} -- If that above quest is complete, It will teleport you here.
if queststatus == -1 then
doCreatureSay(cid, "Sorry, you did not stand at every throne!", TALKTYPE_ORANGE_1) else doTeleportThing(cid, area,0) doCreatureSay(cid, "CONGRATULATIONS!", TALKTYPE_ORANGE_1)
end
return 1
end
queststatus = getPlayerStorageValue(cid,10005) .
queststatus = getPlayerStorageValue(cid,10001) -- Quest number that needs to be COMPLETE.
queststatus = getPlayerStorageValue(cid,10002) -- Quest number that needs to be COMPLETE.
queststatus = getPlayerStorageValue(cid,10007) -- Quest number that needs to be COMPLETE.
queststatus = getPlayerStorageValue(cid,10003) -- Quest number that needs to be COMPLETE.
queststatus = getPlayerStorageValue(cid,10004) -- Quest number that needs to be COMPLETE.
area = {x=482, y=1185, z=12} -- If that above quest is complete, It will teleport you here.
if queststatus == -1 then
doCreatureSay(cid, "Sorry, you did not stand at every throne!", TALKTYPE_ORANGE_1) else doTeleportThing(cid, area,0) doCreatureSay(cid, "CONGRATULATIONS!", TALKTYPE_ORANGE_1)
end
return 1
end
I have complatly no idea why it is not working.
-----------------------------------------------------------------------------------------------------------------
And my another problem with a switch.
I want to remove a fire wall after a player will switch a switch.
Here is a script:
<action uniqueid="12304" script="Poi/Poi_FireWalls.lua"/>
function onUse(cid, item, frompos, item2, topos)
gatepos = {x=477, y=1275, z=10, stackpos=1}
getgate = getThingfromPos(gatepos)
if item.uid == 12304 and item.itemid == 1945 and getgate.itemid == 5062 then
doRemoveItem(getgate.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 12304 and item.itemid == 1946
and getgate.itemid == 0 then
doCreateItem(5062,1,gatepos)
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return 1
end
gatepos = {x=477, y=1275, z=10, stackpos=1}
getgate = getThingfromPos(gatepos)
if item.uid == 12304 and item.itemid == 1945 and getgate.itemid == 5062 then
doRemoveItem(getgate.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 12304 and item.itemid == 1946
and getgate.itemid == 0 then
doCreateItem(5062,1,gatepos)
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return 1
end
where
x=477, y=1275, z=10 ----> it is the position of my switch
1945 - id of the witch
12304 - uniqueid of the switch
5062 - id of the fire wall
That freaking me out because that script is a copy of it below and that below works and that above does not.I constantly get a massage "Sorry, not possible"
function onUse(cid, item, frompos, item2, topos)
gatepos = {x=506, y=1235, z=10, stackpos=1}
getgate = getThingfromPos(gatepos)
if item.uid == 12303 and item.itemid == 1945 and getgate.itemid == 1304 then
doRemoveItem(getgate.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 12303 and item.itemid == 1946
and getgate.itemid == 0 then
doCreateItem(1304,1,gatepos)
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return 1
end
gatepos = {x=506, y=1235, z=10, stackpos=1}
getgate = getThingfromPos(gatepos)
if item.uid == 12303 and item.itemid == 1945 and getgate.itemid == 1304 then
doRemoveItem(getgate.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 12303 and item.itemid == 1946
and getgate.itemid == 0 then
doCreateItem(1304,1,gatepos)
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return 1
end
If anyone could help that would be great