Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
MonsterComponent has a die() method, you don't need to make your own method for killing a monster.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
-
- Posts: 7
- Joined: Mon Mar 11, 2024 11:44 pm
Re: Useful scripts repository
I need help with this script. It is probably the wrong forum to post in on here but having trouble finding where to post.
I keep getting this error message and need help to get the script right.
edit by Zo Kath Ra:
I've moved your post to a topic where it should feel more at home
And taken the liberty of formatting your code with a https://duckduckgo.com/?t=lm&q=lua+beautifier
I keep getting this error message and need help to get the script right.
Code: Select all
sDone = false
shownOnce = false
gotTreasure = false
questAccepted = false
questComplete = false
function fight()
local ratling = findEntity("dialogue_demo_ratling")
if (ratling) then
ratling.brain:enable()
end
isDone = true
end
function treasure()
setMouseItem(spawn("cheese").item)
isDone = true
end
function hasItem()
local champion = party:getChampion(0) -- Slot 0 = first champion "The getChampion error is nil"
-- Loop through all items in the champion's inventory
for i = 1, 32 do -- Each champion has up to 32 inventory slots
local item = champion:getItem(i)
if item and item.go.name == "gold_key" then
return true
end
end
return false
end
I've moved your post to a topic where it should feel more at home

And taken the liberty of formatting your code with a https://duckduckgo.com/?t=lm&q=lua+beautifier
Re: Useful scripts repository
What error message(s), and can you elaborate upon exactly how this script is used, aside from it enabling the ratling. and searching the champion's inventory for the key?supercell1970 wrote: ↑Sat Apr 19, 2025 7:41 pm I keep getting this error message and need help to get the script right.