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

Solved Talkaction help please!

Lanibox

Brutal1ty.com
Joined
Sep 21, 2010
Messages
179
Reaction score
4
Hey, console says "Then expected near '=' "

PHP:
local status = 0
local tpos1 = {X = 32343, y = 32220, z = 7, stackpos=1}
local eventpos = {x = 31819, y = 32248, z = 6}
local teleportId = 1387

local config = {
	positions = {
       		["Event"] = { X = 32343, y = 32220, z = 7 },
	},
 
	effects = {
		CONST_ME_FIREWORK_YELLOW,
		CONST_ME_FIREWORK_RED,
		CONST_ME_FIREWORK_BLUE,
		CONST_ME_HOLYDAMAGE,
		CONST_ME_TELEPORT,
		CONST_ME_FIREAREA
	},

	colors = {
		TEXTCOLOR_RED,
		TEXTCOLOR_ORANGE,
		TEXTCOLOR_GREEN
	}
}

local function effect(tpos1)
	if status == 0 then
	
	else
		for text, pos in pairs(config.positions) do
			doSendMagicEffect(pos, config.effects[math.random(1, #config.effects)])
			doSendMagicEffect(pos, config.effects[math.random(1, #config.effects)])
			doSendMagicEffect(pos, config.effects[math.random(1, #config.effects)])
			doSendAnimatedText(pos, text, config.colors[math.random(1, #config.colors)])
		end
	addEvent(effect, 2000, tpos1)
	end
	return TRUE

end

function onSay(cid, words, param)
	if words = "!rstop" then
		if getThingfromPos(tpos1).itemid == config.teleportId then
			doRemoveItem(getThingfromPos(tpos1).uid)
			broadcastMessage("Event Is Closed now!", messagesort)
			status == 0

		else
			doPlayerSendCancel(cid, 'Event Is not running!')
		end

    		return TRUE
	end

	If words = "!rstart" then
		if getThingfromPos(tpos1).itemid == config.teleportId then
			doPlayerSendCancel(cid, 'Event Is Allready Running!')
		else
			broadcastMessage("Event Is Open Now! Prizes are awesome!", messagesort)
			teleport = doCreateTeleport(teleportId, eventpos, tpos1)
			status == 1
			addEvent(effect, 100, tpos1)
		end

		return TRUE
	end
end

Dont laugh me if I have coded it stupid way etc :D Its been long time since I have coded anything, I dont want to use globalevent for this event.
 
Last edited:
LUA:
local status = 0
local tpos1 = {x = 32343, y = 32220, z = 7, stackpos=1}
local eventpos = {x = 31819, y = 32248, z = 6}
local teleportId = 1387

local config = {
	positions = {
			   ["Event"] = { x = 32343, y = 32220, z = 7 }
	},
	effects = {
		CONST_ME_FIREWORK_YELLOW,
		CONST_ME_FIREWORK_RED,
		CONST_ME_FIREWORK_BLUE,
		CONST_ME_HOLYDAMAGE,
		CONST_ME_TELEPORT,
		CONST_ME_FIREAREA
	},
	colors = {
		TEXTCOLOR_RED,
		TEXTCOLOR_ORANGE,
		TEXTCOLOR_GREEN
	}
}

local function effect(tpos1)
	if status ~= 0 then
		for text, pos in pairs(config.positions) do
			doSendMagicEffect(pos, config.effects[math.random(1, #config.effects)])
			doSendMagicEffect(pos, config.effects[math.random(1, #config.effects)])
			doSendMagicEffect(pos, config.effects[math.random(1, #config.effects)])
			doSendAnimatedText(pos, text, config.colors[math.random(1, #config.colors)])
		end
		addEvent(effect, 2000, tpos1)
	end
	return true
end

function onSay(cid, words, param)
	if words == "!rstop" then
		if getThingfromPos(tpos1).itemid == config.teleportId then
			doRemoveItem(getThingfromPos(tpos1).uid)
			broadcastMessage("Event Is Closed now!", messagesort)
			status = 0
		else
			doPlayerSendCancel(cid, 'Event Is not running!')
		end
		return true
	end

	if words == "!rstart" then
		if getThingfromPos(tpos1).itemid == config.teleportId then
			doPlayerSendCancel(cid, 'Event Is Allready Running!')
		else
			broadcastMessage("Event Is Open Now! Prizes are awesome!", messagesort)
			teleport = doCreateTeleport(teleportId, eventpos, tpos1)
			status = 1
			addEvent(effect, 100, tpos1)
		end

		return true
	end
end
some errors corrected, but I suspect it's not all :D
 
change
status == 1
to
status = 1

change
if words = "XXXX" then
to
if words == "XXX" then

LUA:
local status = 0
local tpos1 = {x = 32343, y = 32220, z = 7, stackpos=1}
local eventpos = {x = 31819, y = 32248, z = 6}
local teleportId = 1387

local config = {
	positions = {
			   ["Event"] = { x = 32343, y = 32220, z = 7 }
	},
	effects = {
		CONST_ME_FIREWORK_YELLOW,
		CONST_ME_FIREWORK_RED,
		CONST_ME_FIREWORK_BLUE,
		CONST_ME_HOLYDAMAGE,
		CONST_ME_TELEPORT,
		CONST_ME_FIREAREA
	},
	colors = {
		TEXTCOLOR_RED,
		TEXTCOLOR_ORANGE,
		TEXTCOLOR_GREEN
	}
}

local function effect(tpos1)
	if status ~= 0 then
		for text, pos in pairs(config.positions) do
			doSendMagicEffect(pos, config.effects[math.random(1, #config.effects)])
			doSendMagicEffect(pos, config.effects[math.random(1, #config.effects)])
			doSendMagicEffect(pos, config.effects[math.random(1, #config.effects)])
			doSendAnimatedText(pos, text, config.colors[math.random(1, #config.colors)])
		end
		addEvent(effect, 2000, tpos1)
	end
	return true
end

function onSay(cid, words, param)
	if words == "!rstop" then
		if getThingfromPos(tpos1).itemid == config.teleportId then
			doRemoveItem(getThingfromPos(tpos1).uid)
			broadcastMessage("Event Is Closed now!", messagesort)
			status = 0
		else
			doPlayerSendCancel(cid, 'Event Is not running!')
		end
		return true
	end

	if words == "!rstart" then
		if getThingfromPos(tpos1).itemid == config.teleportId then
			doPlayerSendCancel(cid, 'Event Is Allready Running!')
		else
			broadcastMessage("Event Is Open Now! Prizes are awesome!", messagesort)
			teleport = doCreateTeleport(teleportId, eventpos, tpos1)
			status = 1
			addEvent(effect, 100, tpos1)
		end

		return true
	end
end
some errors corrected, but I suspect it's not all :D

Thank you both! Yeah, there was one more bug, but fixed it! Thanks again! Its working :)
 
Back
Top