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

Lua Console Errors with marry and alot!

Amiroslo

Excellent OT User
Joined
Jul 28, 2009
Messages
6,768
Solutions
5
Reaction score
769
Im getting this wen server starts up!
Code:
[Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/DoubleExp.lua:1: unexpected symbol near '=='
[Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/DoubleExp.lua)
data/creaturescripts/scripts/DoubleExp.lua:1: unexpected symbol near '=='
[Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/DoubleExp.lua:1: unexpected symbol near '=='
[Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/DoubleExp.lua)
data/creaturescripts/scripts/DoubleExp.lua:1: unexpected symbol near '=='
 
Last edited:
Code:
mysql_real_query(): UPDATE `players` SET `onlinetimeall`=players.onlinetimeall+300 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimeall' in 'field list' (1054)
You gotta be kidding, you just told us the answer of that problem -.-

@OnTopic:
Post the scripts, so we can help you.
 
marry.lua
Lua:
function onLook(cid, thing, position, lookDistance)
	if isPlayer(thing.uid) then
		local k = getPlayerMarriage(getPlayerGUID(thing.uid))
		if k then
			doPlayerSetSpecialDescription(thing.uid,'. ' .. (thing.uid == cid and 'You are' or (getPlayerSex(thing.uid) == 0 and 'She' or 'He') .. ' is') .. ' married to ' .. getPlayerNameByGUID(k))
		end
	end
	return true
end

DoubleExp.lua
Lua:
local level == getPlayerLevel(cid)
local storage = 77788
local value = 1.25 -- 1.25 being 125% meaning normal + 25%
function onLogin(cid) 
    if (getPlayerLastLogin(cid) == nil) then
		setPlayerStorageValue(cid, storage, 2000 + 1)
		doPlayerSendTextMessage(cid, "Buy VIP to get doubled exp") 
    elseif (isPremium(cid)) then
		setPlayerStorageValue(cid, storage, 2001 + 1)
		doPlayerSetExtraExpRate(cid, value) 
		doPlayerSendTextMessage(cid, "You are level " .. getPlayerLevel(cid) .. ". At this level your current doubled exp is " .. getExperienceStage(level) * 2 .. "experience points!") 
    end
	registerCreatureEvent(cid, "DoubleExp-Logout")
	return true
end

function onLogout(cid) 
	if (isPremium(cid) and getPlayerStorageValue(cid, storage) == 2002) then
		doPlayerSetExtraExpRate(cid, -1 * value) 
		setPlayerStorageValue(cid, storage, 2001)
    end
	return true
end
 
Last edited:
marry.lua
Lua:
function onLook(cid, thing, position, lookDistance)
	if isPlayer(thing.uid) then
		local k = getPlayerMarriage(getPlayerGUID(thing.uid))
		if k then
			doPlayerSetSpecialDescription(thing.uid,'. ' .. (thing.uid == cid and 'You are' or (getPlayerSex(thing.uid) == 0 and 'She' or 'He') .. ' is') .. ' married to ' .. getPlayerNameByGUID(k))
		end
	end
	return true
end

DoubleExp.lua
Lua:
local level == getPlayerLevel(cid)
local storage = 77788
local value = 1.25 -- 1.25 being 125% meaning normal + 25%
function onLogin(cid) 
    if (getPlayerLastLogin(cid) == nil) then
		setPlayerStorageValue(cid, storage, 2000 + 1)
		doPlayerSendTextMessage(cid, "Buy VIP to get doubled exp") 
    elseif (isPremium(cid)) then
		setPlayerStorageValue(cid, storage, 2001 + 1)
		doPlayerSetExtraExpRate(cid, value) 
		doPlayerSendTextMessage(cid, "You are level " .. getPlayerLevel(cid) .. ". At this level your current doubled exp is " .. getExperienceStage(level) * 2 .. "experience points!") 
    end
	registerCreatureEvent(cid, "DoubleExp-Logout")
	return true
end

function onLogout(cid) 
	if (isPremium(cid) and getPlayerStorageValue(cid, storage) == 2002) then
		doPlayerSetExtraExpRate(cid, -1 * value) 
		setPlayerStorageValue(cid, storage, 2001)
    end
	return true
end

dude
you need to learn the basics of LUA
if you assign a value to a variable you have to use the '=' parameter, but if you compare a variable with another one you use '=='. Means in LINE 1 (!!!!! thats the error message) you are using '=='...

change
Code:
local level == getPlayerLevel(cid)
to
Code:
local level = getPlayerLevel(cid)
this will solve the FIRST error!
 
marry.lua
Lua:
function onLook(cid, thing, position, lookDistance)
	if isPlayer(thing.uid) then
		local k = getPlayerMarriage(getPlayerGUID(thing.uid))
		if k then
			doPlayerSetSpecialDescription(thing.uid,'. ' .. (thing.uid == cid and 'You are' or (getPlayerSex(thing.uid) == 0 and 'She' or 'He') .. ' is') .. ' married to ' .. getPlayerNameByGUID(k))
		end
	end
	return true
end

DoubleExp.lua
Lua:
local level == getPlayerLevel(cid)
local storage = 77788
local value = 1.25 -- 1.25 being 125% meaning normal + 25%
function onLogin(cid) 
    if (getPlayerLastLogin(cid) == nil) then
		setPlayerStorageValue(cid, storage, 2000 + 1)
		doPlayerSendTextMessage(cid, "Buy VIP to get doubled exp") 
    elseif (isPremium(cid)) then
		setPlayerStorageValue(cid, storage, 2001 + 1)
		doPlayerSetExtraExpRate(cid, value) 
		doPlayerSendTextMessage(cid, "You are level " .. getPlayerLevel(cid) .. ". At this level your current doubled exp is " .. getExperienceStage(level) * 2 .. "experience points!") 
    end
	registerCreatureEvent(cid, "DoubleExp-Logout")
	return true
end

function onLogout(cid) 
	if (isPremium(cid) and getPlayerStorageValue(cid, storage) == 2002) then
		doPlayerSetExtraExpRate(cid, -1 * value) 
		setPlayerStorageValue(cid, storage, 2001)
    end
	return true
end

bump
 
Back
Top