• 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 onUse script help

AnarchGov

Member
Joined
Oct 3, 2011
Messages
263
Reaction score
6
LUA:
 local t, doEet = {
	{x=3850, y=1974, z=2}
}
function onUse(cid, item)
		doSummonCreature("Demon")
	end
	addEvent(doEet, 30 * 60000)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You pissed off the Devil....your move.")
end


This script is intended for an item in game that when used creates a monster. The error i am getting on my server is saying i need to add an "(" on line 4 near "onUse". Obviously, there is no needed parenthesis there. Do i need to add in the id of the item? If so here is the id: 1904

Thanks otland!

REP++
 
The error is from the table you made, you added t and doEet, the position is then for the t, but the doEet has nothing. For the rest you end the function onUse already under the doSummonCreature so the rest won't work and will give an error too.
Also you have to add a position to the doSummonCreature
LUA:
	doSummonCreature("Demon", {x=3850, y=1974, z=2})

I'm not sure what you are trying to do with the addEvent.
 
try:
LUA:
local t =	{x=3850, y=1974, z=2}

function onUse(cid, item)
	addEvent(doSummonCreature, 30 * 60000, "Demon", t)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You pissed off the Devil....your move.")
	return true
end
 
Who do you want to get teleported to this pos:{x=3850, y=1974, z=2}?

They player or the demon?
 
Try to explain what you want to make. Like I said in my other post you have to add a position to the doSummonCreature to let it spawn, so what are you trying to make with the addEvent?
 
So basically, i want to make it so lets say when you kill the boss Morgaroth, a teleport appears for 60 seconds allowing you to escape. But the teleport only appears once the monster has been killed. Ill try that Limos.
 
Shit i'm sorry. i got posts mixed up.

This script: When you right click a blood stain(what i am using) it makes a monster appear. In my case i want it to be a custom boos that i made called "Devil"
 
Then the only thing you have to use is this
LUA:
	doSummonCreature("Demon", {x=3850, y=1974, z=2})
and the textmessage (and ofc the function onUse and end)
 
LUA:
local demonpos = {x=1, y=2, z=7} -- edit pos x y z
local t, doEet = {
	{x=3850, y=1974, z=2}
}
function onUse(cid, item)
		doSummonCreature("Demon", demonpos)
	end
	addEvent(doEet, 30 * 60000)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You pissed off the Devil....your move.")
end
 
Back
Top