• 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] Request or remake code Rep+

hehe this script DONT KNOW what you want to do ;d it won't read it from your brain, so you need to program it step by step.

Give me more info how its supposed to work. What if player specified by param 'playername' is offline? What this command should exactly do, just write these codes, and player name to file?

See how it looks formatted:
Code:
function onSay(cid, words, param)
	param = param.explode(param, ',')
	dir = "C:\otserv\data\codes.lua"
	code = {param[0], param[1], param[2], param[3]}
	name = words(getPlayerByName(cid))

	if getPlayerStorageValue(cid, 12000) == FALSE then
		if param == '" .. code .. "' and (words == '" .. name .. "') then
			for i = 1, #code do
				doWriteLogFile(dir, #code[i])
				doPlayerSendTextMessage(cid, 22, "Succesfull Send")
				setPlayerStorageValue(cid, 12000, 1)
		else
			doPlayerSendTextMessage(cid, 14, "Already Sent")
	else
		doPlayerSendTextMessage(cid, 14, "Code dont Exist")
	end

	return 1
	end
end

Now you should see that there are 2x end after 'return 1', and 'for' is without end.
 

Similar threads

Back
Top