lua:scripting:examples:turninobjects
Differences
This shows you the differences between two versions of the page.
| lua:scripting:examples:turninobjects [2014/12/24 05:44] – created vodur | lua:scripting:examples:turninobjects [2026/10/16 20:02] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | <code lua> | + | |
| - | -- Initializes the tracker variable with empty names if it doesn' | + | |
| - | tracker = tracker or { | + | |
| - | [18405] = "", | + | |
| - | [18406] = "", | + | |
| - | [18407] = "", | + | |
| - | [18408] = "", | + | |
| - | [18409] = "", | + | |
| - | [18410] = "", | + | |
| - | [18411] = "", | + | |
| - | [18412] = "", | + | |
| - | [18413] = "", | + | |
| - | [18425] = "", | + | |
| - | [18430] = "", | + | |
| - | } | + | |
| - | + | ||
| - | if tracker[obj1.vnum] == nil then -- We don't want this thing | + | |
| - | say("I don't want that!" | + | |
| - | mdo(" | + | |
| - | return | + | |
| - | end | + | |
| - | + | ||
| - | if tracker[obj1.vnum] == ch.name then -- Player was the last one to give it | + | |
| - | say(" | + | |
| - | mdo(" | + | |
| - | mdo(" | + | |
| - | return | + | |
| - | end | + | |
| - | + | ||
| - | -- If we got here then we need to reward and track the player | + | |
| - | say(" | + | |
| - | obj1: | + | |
| - | reward(ch, " | + | |
| - | tracker[obj1.vnum]=ch.name | + | |
| - | </ | + | |
