• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Talkaction gone wrong

ziggy46802

Active Member
Joined
Aug 19, 2012
Messages
418
Reaction score
27
Heres the talkaction

LUA:
function onSay(cid, words, param, channel)

if getPlayerStorageValue(cid, 25001) == 1 and getPlayerLevel(cid) => 5 and getPlayerStorageValue(cid, 26001) <= 6 then
		doPlayerPopupFYI(cid, "You prayed to the dwarven God and received a bonus to your max health and a bonus to your shielding stat.")
		setStorageValue(cid, 26001, 5)
		setCreatureMaxHealth(cid, ((getCreatureMaxHealth(cid))+15))
		doPlayerAddSkillTry(cid, 5, 125)
end

	return true
end

And heres the error code
[15:14:27.891] [Error - LuaInterface::loadFile] data/talkactions/scripts/race/thedwarf.lua:3: 'then' expected near '='
 
Code:
function onSay(cid, words, param, channel)
 
if getPlayerStorageValue(cid, 25001) == 1 and getPlayerLevel(cid) >= 5 and getPlayerStorageValue(cid, 26001) <= 6 then
		doPlayerPopupFYI(cid, "You prayed to the dwarven God and received a bonus to your max health and a bonus to your shielding stat.")
		setStorageValue(cid, 26001, 5)
		setCreatureMaxHealth(cid, ((getCreatureMaxHealth(cid))+15))
		doPlayerAddSkillTry(cid, 5, 125)
end
 
	return true
end

The comparison math symbols in lua are used as the following :

Code:
==  >  <  >=  <=  ~=
 
Last edited:
if getPlayerStorageValue(cid, 25001) == 1 and getPlayerLevel(cid) => 5 and getPlayerStorageValue(cid, 26001) <= 6 then

Your script /\ correct script \/

if getPlayerStorageValue(cid, 25001) == 1 and getPlayerLevel(cid) >= 5 and getPlayerStorageValue(cid, 26001) <= 6 then
 
Back
Top