function onUse(cid, item, frompos, topos)
local group = 5 -- Group ID of gamemaster
if getPlayerGroupID(cid) ~= group then
if getPlayerStorageValue(cid 1000) ~= 1 then
doPlayerAddItem(cid, 2400, 1)
doPlayerSendTextMessage(cid, 22, "You have found a magic sword.")
setPlayerStorageValue(cid, 1000)
else
doPlayerSendTextMessage(cid, 22, "You have already done this quest.")
end
else
doPlayerSendTextMessage(cid, 22, "Only players can do this quest.")
end
return TRUE
end