<talkaction words="/mounts" separator=" " script="allmounts.lua" />
function onSay(player, words, param)
if not player:getGroup():getAccess() then
return true
end
local target
if param == '' then
target = player:getTarget()
if not target then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Unlocks all mounts for certain player. Usage: /mounts <player name>')
return false
end
else
target = Player(param)
end
if not target then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Player ' .. param .. ' is not currently online.')
return false
end
if player:getAccountType() < ACCOUNT_TYPE_GOD then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Cannot perform action.')
return false
end
for i = 1, 90 do
target:addMount(i)
end
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'All mounts unlocked for: ' .. target:getName())
target:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, '[Server] All mounts unlocked.')
return false
end
Tested on TFS 1.2
This command give all mounts to player, example: /mounts playerName
Code:<talkaction words="/mounts" separator=" " script="allmounts.lua" />Code:function onSay(player, words, param) if not player:getGroup():getAccess() then return true end local target if param == '' then target = player:getTarget() if not target then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Unlocks all mounts for certain player. Usage: /mounts <player name>') return false end else target = Player(param) end if not target then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Player ' .. param .. ' is not currently online.') return false end if player:getAccountType() < ACCOUNT_TYPE_GOD then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Cannot perform action.') return false end for i = 1, 90 do target:addMount(i) end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'All mounts unlocked for: ' .. target:getName()) target:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, '[Server] All mounts unlocked.') return false end
A mount is just like an addon it is a looktype.I wanted to know the following, I want to give the Batcat mount to the test player, how do I?
You can use "/mounts playername" to give all mounts to the player.
If you didn't get batcat mount, you need to add it to mounts.xml
<talkaction words="/addmount" separator=" " script="add_mount.lua" />
function onSay(player, words, param)
if not player:getGroup():getAccess() then
return true
end
if player:getAccountType() < ACCOUNT_TYPE_GOD then
return false
end
local split = param:split(",")
if split[2] == nil then
player:sendCancelMessage("Try: '/addmount playername, mountId'.")
return false
end
local target = Player(split[1])
if target == nil then
player:sendCancelMessage("Targeted player is not online.")
return false
end
local mountId = split[2]
if target:hasMount(mountId) then
player:sendCancelMessage("Targeted player already has a mount you chose.")
else
player:sendTextMessage(MESSAGE_EVENT_ORANGE, string.format("Mount of id: [%d] has been added to player: %s.", mountId, target:getName()))
target:addMount(mountId)
end
return false
end