Hello, i always wanted to making a race event long time ago. But i had no coding skills todo it. Now several years later, i got the idea back into my head. But i thougt it was boring, then i remember i watched the movie 'Tron Legacy', so here we are a hour later
Todo
- Add boost and jump command!
- Hitting the wall, should kill you! [Now only player field kill you]
- Clean up and optimize!
Add this into actions/actions.xml
Code:
<action actionid="8000" script="tronEventLever.lua" />
Create "tronEventLever.lua" inside actions/scripts and paste this:
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 1945 then
if tronEvent:onUseLever(player) == false then
return true
end
end
item:transform(item.itemid == 1945 and 1946 or 1945)
return true
end
Now inside movements/movements.xml you need remove these lines:
Code:
<movevent event="AddItem" itemid="1492" function="onAddField" />
<movevent event="StepIn" itemid="1493" function="onStepInField" />
<movevent event="StepIn" itemid="1500" function="onStepInField" />
<movevent event="AddItem" itemid="1500" function="onAddField" />
<movevent event="StepIn" itemid="1506" function="onStepInField" />
<movevent event="AddItem" itemid="1506" function="onAddField" />
And add this instead:
Code:
<movevent event="StepIn" itemid="1492" script="tronEventMovement.lua" />
<movevent event="StepIn" itemid="1500" script="tronEventMovement.lua" />
<movevent event="StepIn" itemid="1506" script="tronEventMovement.lua" />
Now create "tronEventMovement.lua" and inside movements/scripts and paste this:
Code:
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if player == nil then
return false
end
position:sendMagicEffect(CONST_ME_FIREAREA)
tronEvent:onPlayerDeath(player, tonumber(item:getAttribute(ITEM_ATTRIBUTE_TEXT)) or 0)
return true
end
Now in data/global.lua add this line:
Code:
dofile('data/tronEvent.lua')
Create new lua inside data folder and name it: "tronEvent.lua" and paste this:
http://pastebin.com/qdjptfYe