Jump to content

Fun command shelp


Recommended Posts

addCommandHandler ("use",
function(player,command,Fun,FunPlayerName)
   if (findPlayerByName (FunPlayerName)) then 
     local playerToFun = findPlayerByName (FunPlayerName)
     local Text =  (Fun)
     outputChatBox (getPlayerName(player) .. " #FF0000is use ".. Text .." with " .. getPlayerName(playerToFun),getRootElement(),51,255,0,true)
end
end)

whats Wrong

Edited by Guest
Link to comment
addCommandHandler ("use",
function(player,command,Fun,FunPlayerName)
   if (findPlayerByName (FunPlayerName)) then 
     local playerToFun = findPlayerByName (FunPlayerName)
     local Text =  (Fun)
     outputChatBox (getPlayerName(player) .. " #FF0000is use ".. Text .." with " .. getPlayerName(playerToFun),getRootElement(),51,255,0,true)
end
end)

whats Wrong

50p means, what is wrong?

what is it suppose to be, and what doesn't work about it.;)

Link to comment

There's no function findPlayerByName, unless you create one. If you need to get player with a specified nickname, use getPlayerFromName. And it's better to store function result in a variable if you need to use it a few times. I'll try to correct your code

addCommandHandler("use",
function(player,command,Fun,FunPlayerName)
local playerToFun = getPlayerFromName(FunPlayerName)
if playerToFun then
outputChatBox (FunPlayerName.." #FF0000is use "..Fun.." with "..getPlayerName(player),getRootElement(),51,255,0,true)
end
end
)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...