function init() body = FindBody("oldnewspaper") SetTag(body,"interact", "loc@PICK_UP") SetDescription(body, "loc@YESTERDAY'S_NEWSPAPER") arrowLocation = FindLocation("arrow") arrow = LoadSprite("gfx/arrowdown.png") refillSound = LoadSound("tool_pickup.ogg") done = false mapMarker = FindBody("map") end function tick(dt) if done then return end drawArrow(arrowLocation) if GetPlayerInteractBody() == body and InputPressed("interact") then done = true RegisterTool("papergun","loc@PAPER_GUN","MOD/vox/papergun.vox") SetBool("game.tool.papergun.enabled",true) SetInt("game.tool.papergun.ammo",20) SetString("game.tool.papergun.name","loc@OLD_NEWSPAPERS") SetString("game.player.tool","papergun") PlaySound(refillSound,GetBodyTransform(body).pos) Delete(body) Delete(mapMarker) end if GetBool("level.run") then done = true Delete(body) end end function drawArrow(location) if GetBool("game.map.enabled") then return end local arrowPos = GetLocationTransform(location).pos local c = GetCameraTransform().pos c[2] = arrowPos[2] local p = VecCopy(arrowPos) p[2] = p[2] + math.sin(GetTime()*5)*0.3+0.3 + 2 local t = Transform(p, QuatLookAt(arrowPos, c)) DrawSprite(arrow, t, 2, 2, .3, .3, .3, 3, false, true) DrawSprite(arrow, t, 2, 2, 1, 1, 1, 1, true, true) end