What's new

Pomoc z skryptem plx poprawki

Status
Not open for further replies.

Quomak

Senior User
Joined
Jul 15, 2010
Messages
631
Reaction score
40
Age
10
Z silnika:

[Error - LuaScriptInterface::loadFile] data/talkactions/scripts/creature.lua:29: '<eof>' expected near 'end'
[27/12/2010 11:25:20] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/creature.lua)
[27/12/2010 11:25:20] data/talkactions/scripts/creature.lua:29: '<eof>' expected near 'end'
Code:
functiononSay(cid, words, param, channel)
	local func = doCreateMonster
	if(words:sub(2, 2) == "n") then
		func = doCreateNpc
	end

	local pid = cid
	local t = string.explode(param, ",")
	if(2) then
		pid = getPlayerByNameWildcard(t[2])
		if(not pid) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")
			return true
		end
	end

	local position = getCreaturePosition(pid)
	local effect = CONST_ME_MAGIC_RED
	local ret = func(t[1], position, false)
	if(tonumber(ret) == nil) then
		effect = CONST_ME_POFF
		doPlayerSendDefaultCancel(cid, (ret == false and RETURNVALUE_NOTPOSSIBLE or RETURNVALUE_NOTENOUGHROOM))
	end

	doSendMagicEffect(position, effect)
	
return true

end
Notka moderatorska:
U?ywaj
Code:
[/mod]
Prosze o poprawke za pomoc reput
 

Dasper

Active User
Joined
Nov 25, 2010
Messages
99
Reaction score
19
Odp: Pomoc z skryptem plx poprawki

Prosz? oto m?j skrypt:

Talkactions.xml

Code:
<talkaction log="yes" words="/m" access="4" event="script" value="creature.lua"/>

talkactions/scripts.creature.lua

Code:
function onSay(cid, words, param, channel)
	local func = doCreateMonster
	if(words:sub(2, 2) == "n") then
		func = doCreateNpc
	end

	local pid = cid
	local t = string.explode(param, ",")
	if(t[2]) then
		pid = getPlayerByNameWildcard(t[2])
		if(not pid) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")
			return true
		end
	end

	local position = getCreaturePosition(pid)
	local effect = CONST_ME_MAGIC_RED
	local ret = func(t[1], position, false)
	if(tonumber(ret) == nil) then
		effect = CONST_ME_POFF
		doPlayerSendDefaultCancel(cid, (ret == false and RETURNVALUE_NOTPOSSIBLE or RETURNVALUE_NOTENOUGHROOM))
	end

	doSendMagicEffect(position, effect)
	return true
end

PS. Skrypt jest do robienia potwor?w, nie items.

Regards,
Dasper

Notka moderatorska:
OT Expert, + 1pkt
 
Last edited by a moderator:

Quomak

Senior User
Joined
Jul 15, 2010
Messages
631
Reaction score
40
Age
10
Zaraz spraqwdze
Bardzo dzieuje dziala bardzo dziekuje reput + podziekowanie i zapraszam w dziale hamachi ppw-perfect pokemon world
Przepraszam nie zauwazylem ze post pod postem prosze o sklejenie :)
Notka moderatorska:
Ostatni raz wlepiam upomnienie. Nast?pnym razem polec? ju? punkty
 
Last edited by a moderator:
Status
Not open for further replies.
Top