This works, but then my shop that gesior made doesn't work.
And when i change the name to login3.lua And adding this line to creaturescripts.lua
PHP:<event type="login" name="PlayerLogin" script="login3.lua"/>
It doesn't work. Can someone please help me out?
Nice bump of old threadYou need to understand whats going on better and be able to edit scripts as appropriate if you think you deserve to be running a shop.
Please make one, that would be gold.It is easier to make a login function that checks a storage for premium and free players... You don't have to check areas.
No, it will not. It's just checking floor 7Hello
this script work in tfs 1.2?
and other question...
Example
it will work if the player are in others floors? z=8 z=9 z=10 or z=-1 z=-2 etc...?
TFS 1.2So is working on 0.4 only?
local config = {
freeTemple = Position(438, 503, 8), -- This is the Free account temple position
topArea = Position(370, 592, 7), -- This is the top left Co-ord for checking the Premium area.
bottomArea = Position(403, 645, 7) -- This is the bottom right co-ord for checking the Premium area.
}
-- Top left, and bottom right co-ords exist because isInArea function checks a SQUARE area. from top left to bottom right
function onLogin(player)
if isInArea(player:getPosition(), config.topArea, config.bottomArea) then
if player:getPremiumDays() < 1 then
player:teleportTo(freeTemple)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You no longer have a premium account. Please renew your premium to gain access to the premium areas.')
end
end
player:registerEvent("PlayerDeath")
return true
end
Thanks but looking for function with gonna work with tfs 0.4, so i can close event place and kick all players inside.TFS 1.2
Lua:local config = { freeTemple = Position(438, 503, 8), -- This is the Free account temple position topArea = Position(370, 592, 7), -- This is the top left Co-ord for checking the Premium area. bottomArea = Position(403, 645, 7) -- This is the bottom right co-ord for checking the Premium area. } -- Top left, and bottom right co-ords exist because isInArea function checks a SQUARE area. from top left to bottom right function onLogin(player) if isInArea(player:getPosition(), config.topArea, config.bottomArea) then if player:getPremiumDays() < 1 then player:teleportTo(freeTemple) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You no longer have a premium account. Please renew your premium to gain access to the premium areas.') end end player:registerEvent("PlayerDeath") return true end