• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

[Lua] Fireball

Sir Bananas

Lua Scripter, Spriter
Joined
Jul 19, 2011
Messages
344
Reaction score
29
Location
Brazil
I think this should be very simple..
I just want when i say "/fireball playername" it sends the fireball effect (6) to the player
thanks :D
 
Just edit and resave any spell that attacks the target only, change spell words to /fireball and make the parameter need a player name, just like exiva, and change the effect. Voila.

So take the name require paramter from exiva. Take the target focus out of a focus target spell and change the effect to fireball with 0 damage (unless you want damage) At least this way you get to learn roughly what certain things do! :)
 
Just edit and resave any spell that attacks the target only, change spell words to /fireball and make the parameter need a player name, just like exiva, and change the effect. Voila.

So take the name require paramter from exiva. Take the target focus out of a focus target spell and change the effect to fireball with 0 damage (unless you want damage) At least this way you get to learn roughly what certain things do! :)

It's easier to make it into a talkaction just for the sake of params ^^.
Maybe i'll write it. If I can get the power to open notepad++ up...
 
It's easier to make it into a talkaction just for the sake of params ^^.
Maybe i'll write it. If I can get the power to open notepad++ up...

Here you go buddy;
LUA:
function onSay(cid, words, param, channel)
        local pid = 0
        if(param == '') then
                pid = getCreatureTarget(cid)
                if(pid == 0) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
                        return true
                end
        else
                pid = getPlayerByNameWildcard(param)
        end

        if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " is not currently online.")
                return true
        end

        if(isPlayer(pid) and getPlayerAccess(pid) >= getPlayerAccess(cid)) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot fireball this player.")
                return true
        end

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(pid) .. " has been fireballed.")
        doSendMagicEffect(getCreaturePosition(pid), 6)
        doSendDistanceShoot(getCreaturePosition(cid), getCreaturePosition(pid), 3)
        return true
end
 
Here you go buddy;
LUA:
function onSay(cid, words, param, channel)
        local pid = 0
        if(param == '') then
                pid = getCreatureTarget(cid)
                if(pid == 0) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
                        return true
                end
        else
                pid = getPlayerByNameWildcard(param)
        end

        if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " is not currently online.")
                return true
        end

        if(isPlayer(pid) and getPlayerAccess(pid) >= getPlayerAccess(cid)) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot fireball this player.")
                return true
        end

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(pid) .. " has been fireballed.")
        doSendMagicEffect(getCreaturePosition(pid), 6)
        doSendDistanceShoot(getCreaturePosition(cid), getCreaturePosition(pid), 3)
        return true
end
Lifesaver.
 
Back
Top