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

How to put this script to only premiums ?

picachu

Member
Joined
Dec 2, 2007
Messages
970
Reaction score
11
Hello guys!
I have a little problem with my action script.

The script is:

Lua:
function onUse(cid, item, frompos, item2, topos)
local pos = {x = 453, y = 126, z = 7}
	if getCreatureCondition(cid, CONDITION_INFIGHT) == 0 then
      doTeleportThing(cid,pos)
	else
      doPlayerSendCancel(cid, "You are in a fight or with battle.")
	end
      return 1
end

And the error is:

onUse this item it give me the error 'You are in a fight or with battle' but i'm not with that !!!
I'm using TFS 0.3.6

Can you please fix it?
AND PUT TO JUST PREMIUM PLAYERS USE IT?
Thanks!​
 
Code:
function onUse(cid, item, frompos, item2, topos)
local pos = {x = 453, y = 126, z = 7}
        if getCreatureCondition(cid, CONDITION_INFIGHT) == [COLOR="RoyalBlue"]1[/COLOR] then
      doTeleportThing(cid,pos)
        else
      doPlayerSendCancel(cid, "You are in a fight or with battle.")
        end
      return 1
end

Try with that.
 
Lua:
function onUse(cid, item, frompos, item2, topos)
if getPlayerPremiumDays(cid) > 0 then
local pos = {x = 453, y = 126, z = 7}
        if getCreatureCondition(cid, CONDITION_INFIGHT) == 0 then
      doTeleportThing(cid,pos)
        else
      doPlayerSendCancel(cid, "You are in a fight or with battle.")
        end
      return 1
end
 
Lua:
function onUse(cid, item, frompos, item2, topos)
local pos = {x = 453, y = 126, z = 7}
	if getPlayerPremiumDays(cid) > 0 then
		if getCreatureCondition(cid, CONDITION_INFIGHT) == false then
			doTeleportThing(cid,pos)
		else
			doPlayerSendCancel(cid, "You are in a fight or with battle.")
		end
		return true
	else
		doPlayerSendCancel(cid, 'You are not premium.')
	end
end

@strasxni
You forgot to end the getPlayerPremiumDays
 
Back
Top