- 精华
- 阅读权限
- 50
- 好友
- 相册
- 分享
- 听众
- 收听
- 注册时间
- 2022-1-14
- 在线时间
- 小时
- 最后登录
- 1970-1-1
|
发表于 2024-10-9 23:47:36
|
显示全部楼层
这是抄的其他端随身商店代码,大佬帮忙看看为啥点了没反应呢
if nIndex == 361 then
local xz = LuaFnGetCurrentTime() --现在时间
-- 获取记录临时数据(当前随身商店NPC创建的时间)
local npcStrTime = 'suiShenShangDian'..tostring(selfId)
local sj = tonumber(LuaFnGetGlobalDataString(sceneId, selfId, npcStrTime))
if (xz - sj) <20 then
x890096_Tips(sceneId, selfId,"该功能20秒可使用一次")
return
end
local PlayerSex=GetSex(sceneId,selfId)
local x,z = GetWorldPos(sceneId, selfId)
local objId =LuaFnCreateMonster( sceneId,79, x+1,z+1, 3, 0, 890096 )--这个人形boss 79
SetCharacterName(sceneId,objId,"随身垃圾回收站")
SetCharacterDieTime(sceneId, objId,20000)
LuaFnSetGlobalDataString(sceneId, selfId, npcStrTime, xz)
-- DispatchNoNpcShopItem( sceneId, selfId, 225 ) --225号珍兽杂货店
return
end
--**********************************
--事件交互入口
--**********************************
function x890096_OnDefaultEvent( sceneId, selfId,targetId )
if LuaFnGetName(sceneId, targetId) == "随身垃圾回收站" then
MonsterTalk(sceneId,targetId,"","该商店只存在20s,请谨慎买卖物品,丢失不负责。")
DispatchShopItem( sceneId, selfId, targetId, 27)
end
end |
|