how do i go about destroying this image when another user is selected from server side script
client
function pic()
local screenWidth, screenHeight = guiGetScreenSize()
local lama = guiCreateStaticImage(screenWidth/2 - -290, screenHeight - 80, 220, 100, 'lama.png', false, nil)
end
addEvent("onGreeting", true)
addEventHandler("onGreeting", getRootElement(), pic)
server
function lamaHunt ( player, command, killer )
if ( command and lama ) then
--local blip = getElementData ( source, "lamablip" )
if ( blip ) then
destroyElement ( blip )
blip = nil
end
setPlayerWantedLevel ( lama, 0 )
end
lama = killer or getRandomPlayer()
if ( lama ) then
blip = createBlipAttachedTo ( lama, 23 )
triggerClientEvent ( "onGreeting", getRootElement(), "" )
--setElementData ( lama, "lamablip", blip )
setTimer ( setPlayerWantedLevel, delay, 1, lama, 6 )
setTimer ( outputChatBox, delay, 1, "You're the lama, run!", lama )
for i, v in ipairs ( getElementsByType ( "player" ) ) do
if ( v ~= lama ) then
setTimer ( outputChatBox, delay, 1, getClientName ( lama ) .. " is the lama!", v )
end
end
end
end