^Dev-PoinT^ Posted November 3, 2011 Posted November 3, 2011 Hi all i made This is it Correct or Not and fix it To Know My errors function onKill(ammo, killer, weapon, bodypart) if (killer and killer ~= source) then local x,y,z = getElementPosition(source) createExpliosion (x,y,z, 10) --- TankGreande outputChatBox("You Have Been Explode by..getPlayerName..(killer)"),getRootElement(),255,255,0, true) end addEventHandler ("onPlayerWasted",getRootElement(), onKill)
myonlake Posted November 3, 2011 Posted November 3, 2011 Changes - createExpliosion => createExplosion - by..getPlayerName..(killer)") => by " .. getPlayerName(killer) - fixed some of your typos and little things (couldn't leave them like that heh) function onKill(ammo, killer, weapon, bodypart) if (killer and killer ~= source) then local x, y, z = getElementPosition(source) createExplosion (x, y, z, 10) outputChatBox("You have been exploded by " .. getPlayerName(killer), getRootElement(), 255, 255, 0, true) end end addEventHandler("onPlayerWasted", getRootElement(), onKill) I like that you are copying my code base (my latest thread), good way of learning yeah...
^Dev-PoinT^ Posted November 3, 2011 Author Posted November 3, 2011 Copy Your Code? i made it i swear ! but Thx For Fix i know My errors
FatalTerror Posted November 3, 2011 Posted November 3, 2011 It would be nice if you look at the code given, you have already made that mistake on many topics already created
^Dev-PoinT^ Posted November 3, 2011 Author Posted November 3, 2011 i run it it say @'getPlayerName'[Expected element at argument 1, got boolean]
12p Posted November 3, 2011 Posted November 3, 2011 Make your script check whether "killer" is a player element or not. CLICK THIS ==> getElementType
^Dev-PoinT^ Posted November 3, 2011 Author Posted November 3, 2011 Like This ? function onKill(ammo, killer, weapon, bodypart) if (killer and killer ~= source) then if getElementType ( killer ) == "Player" local x, y, z = getElementPosition(source) createExplosion (x, y, z, 10) outputChatBox("You have been exploded by " .. getPlayerName(killer), getRootElement(), 255, 255, 0, true) end end addEventHandler("onPlayerWasted", getRootElement(), onKill) ?
12p Posted November 3, 2011 Posted November 3, 2011 You got it. but don't use capitals. Here you go, 2 lines less code: function onKill(ammo, killer, weapon, bodypart) if killer and killer ~= source and getElementType ( killer ) == "player" then local x, y, z = getElementPosition(source) createExplosion (x, y, z, 10) outputChatBox("You have been exploded by " .. getPlayerName(killer), getRootElement(), 255, 255, 0, true) end end addEventHandler("onPlayerWasted", getRootElement(), onKill) You are learning...
^Dev-PoinT^ Posted November 3, 2011 Author Posted November 3, 2011 Thx Benxamix2 Work Fine No erros Thx All For Help i have Learn That
myonlake Posted November 3, 2011 Posted November 3, 2011 Oh, you made it, dev? viewtopic.php?f=91&t=36839
^Dev-PoinT^ Posted November 3, 2011 Author Posted November 3, 2011 Nooob ! Your Code is about Money My Code is about Explosion ! and1- getElementPostion is it in Your Code Nah 2- createExplosion is it in Your Code Nah Then yes i made it
myonlake Posted November 4, 2011 Posted November 4, 2011 Nooob ! Your Code is about Money My Code is about Explosion !and1- getElementPostion is it in Your Code Nah 2- createExplosion is it in Your Code Nah Then yes i made it Function name and eventHandler is the same name, including the if (killer and killer ~= source)..
12p Posted November 4, 2011 Posted November 4, 2011 Who cares, myonlake. I started editing Freeroam to delete some buttons and replacing texts... Now look at me. Maybe he's a noob scripter now, but who knows... He may be better than you in some months.
^Dev-PoinT^ Posted November 4, 2011 Author Posted November 4, 2011 i have a problem any Player Next the Player who explode he die to how To Make the other Player dont have damge
12p Posted November 4, 2011 Posted November 4, 2011 There is damaging at the client CreateExplosion function that defines that, check on: createExplosion
^Dev-PoinT^ Posted November 4, 2011 Author Posted November 4, 2011 is there any command like this creatExplosion (x,y,z ,2 ,false) --flase mean damge to the Player who died onley
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now