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

[Help] Send message to players in room

Spoking

Oldschool Developer
Joined
Sep 4, 2007
Messages
434
Reaction score
34
Hi, I made this script but I get an error which I don't know how to fix.

Code:
			local spectators = getSpectators({x=1004,y=1094,z=9}, 10, 10, false) 
		for _, specs in ipairs(spectators) do
			if (isPlayer(specs)) then
				doPlayerSendTextMessage(specs, 25, "Congratulations, you've finished the Arena!")
				doTeleportThing(specs.uid,npcpos,false)
				doPlayerSetStorageValue(specs, 3325, 1)
				setGlobalStorageValue(333334, -1)
			end
		end

{this is just a little part of the script, but the error is here.}

error:
Code:
[29/05/2010 14:57:09] data/actions/scripts/gsarea.lua:200: attempt to index local 'specs' (a number value)
[29/05/2010 14:57:09] stack traceback:
[29/05/2010 14:57:09] 	data/actions/scripts/gsarea.lua:200: in function <data/actions/scripts/gsarea.lua:189>

Does anyone knows how to fix?
 
Code:
		for _, specs in ipairs(getSpectators({x=1004,y=1094,z=9}, 10, 10, false)) do
			if isPlayer(specs) then
				doPlayerSendTextMessage(specs, 25, "Congratulations, you've finished the Arena!")
				doTeleportThing(specs, npcpos)
				setPlayerStorageValue(specs, 3325, 1)
			end
		end
		setGlobalStorageValue(333334, -1)
 
Back
Top