small's script wont work as it is. It calls the non-existent function "DestroySprite".
He is correct about the coordinate system. You're seeing your sprite in the top left because it's initial coordinates are '0 , 0' and "SetSpritePosition ( locationSprite , 100 , 100 )" is never being called. You say your script is attached to an arbitrary entity, set to Static: No and Always Active, then trying to trigger an event on 'plrinzone'. I think you should use a zone, such as a TriggerZone, or if you must use an entity trigger your event using GetPlayerDistance.
I'm sure you can do this with timers, but for me this is easier:
sprite_duration = 6 -- delay time in seconds
showing_sprite = 0
StartTime = 0
function location_init(e)
locationImage = LoadImage ("scriptbank\\images\\location.png")
locationSprite = CreateSprite (locationImage)
SetSpritePosition (locationSprite , 100, 100)
end
local CurrentTime = os.clock
function location_main(e)
if showing_sprite == 0 and GetPlayerInZone(e)==1 then
StartTime = CurrentTime()
SetSpritePosition(locationSprite , 0, 0)
showing_sprite = 1
end
if showing_sprite == 1 and (CurrentTime()-StartTime) > sprite_duration then
SetSpritePosition ( locationSprite , 100, 100 )
Destroy(e)
end
end
Windows 10 Home 64-bit / Intel i5 2500k @ 4.4Ghz + Asetek 510LC / Intel DP67DE / Intel 530 Series 240GB SSD / 12GB Kingston KVR 1333 / XFX Radeon R9 285 / Corsair TX 650 / Antec 300