Diogo souza
New Member
- Joined
- Dec 11, 2018
- Messages
- 22
- Reaction score
- 1
I need to change this script so that the player gains an effect when stepping on 2 different sqm and when the player dies or disconnects, the effect is removed.
The script to be changed below
|
|
V
effect.lua
Now add this to login.lua
Now add this code in creaturescripts.xml
The script to be changed below
|
|
V
effect.lua
Lua:
local effect = 30 -- Effect that will use
local storage = 9994 -- Storage that the player needs to have
local time = 5 -- Time in seconds
function onLogin(cid)
if getPlayerStorageValue(cid, storage) == 1 then
SendEffect(cid )
end
return TRUE
end
function SendEffect(cid)
doSendMagicEffect(getCreaturePosition(cid), effect)
addEvent(SendEffect, time*1000, cid)
return TRUE
end
Now add this to login.lua
Code:
registerCreatureEvent(cid, "Effect")
Now add this code in creaturescripts.xml
Lua:
<event type="login" name="Effect" event="script" value="effect.lua"/>