-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
I'm wondering, what did you guys meant by "booo"?
-
I'm here to help, I don't want a reward for it.
-
You removed one 'end'. exports.scoreboard:scoreboardAddColumn("EXP") exports.scoreboard:scoreboardAddColumn("Level") function win(ammo, killer, weapon, bodypart) local H = getElementData(killer, "EXP") local S = getElementData(killer, "Level") local killer1 = getPlayerName(killer) local noob = getPlayerName(source) if killer and killer ~=source then setElementData(killer, "EXP", tonumber(H)+1) if tonumber(H) == 10 then setElementData(killer, "Level", "Lvl 1") elseif tonumber(H) == 20 then setElementData(killer, "Level", "Lvl 2") elseif tonumber(H) == 30 then setElementData(killer, "Level", "Lvl 3") elseif tonumber(H) == 40 then setElementData(killer, "Level", "Lvl 4") elseif tonumber(H) == 50 then setElementData(killer, "Level", "Lvl 5") elseif tonumber(H) == 60 then setElementData(killer, "Level", "Lvl 6") end outputChatBox(killer1 .. "Killed " .. noob .. " and gained +1 EXP", getRootElement(), 255, 255, 0, false) end end addEventHandler( "onPlayerWasted", getRootElement(), win)
-
If you want to spawn the player who died back to his team location, then why do you check for kills? o_O.
-
exports.scoreboard:scoreboardAddColumn("EXP") exports.scoreboard:scoreboardAddColumn("Level") function win(ammo, killer, weapon, bodypart) local H = getElementData(killer, "EXP") local S = getElementData(killer, "Level") local killer1 = getPlayerName(killer) local noob = getPlayerName(source) if killer and killer ~=source then setElementData(killer, "EXP", tonumber(H)+1) if tonumber(H) == 10 then setElementData(killer, "Level", "Lvl 1") elseif tonumber(H) == 20 then setElementData(killer, "Level", "Lvl 2") elseif tonumber(H) == 30 then setElementData(killer, "Level", "Lvl 3") elseif tonumber(H) == 40 then setElementData(killer, "Level", "Lvl 4") elseif tonumber(H) == 50 then setElementData(killer, "Level", "Lvl 5") elseif tonumber(H) == 60 then setElementData(killer, "Level", "Lvl 6") end outputChatBox(killer1 .. "Killed " .. noob .. " and gained +1 EXP", getRootElement(), 255, 255, 0, false) end end addEventHandler("onPlayerWasted", getRootElement(), Win)
-
Yes, you can, that's pretty obviously.
-
exports.scoreboard:scoreboardAddColumn("EXP") function win(ammo, killer, weapon, bodypart) local H = getElementData(killer, "EXP") local killer1 = getPlayerName(killer) local noob = getPlayerName(source) if killer and killer ~=source then if tonumber(H) < 10 then setElementData(killer, "EXP", tonumber(H)+1) end outputChatBox(killer1 .. "Killed " .. noob .. " and gained +1 EXP", getRootElement(), 255, 255, 0, false) end end addEventHandler("onPlayerWasted", getRootElement(), Win) Should work.
-
You want the player to get +1 EXP point until it reaches 10?
-
Can you explain me what are you trying to do?
-
Care about what? my posts? nah, not really, I just wanted to make this topic when I reached 5000 .
-
No, I don't get what do you want, but what I get is that you want to add +1 exp point each time you kill a player, and that's what my code does.
-
Why do you need a table to just add +1 to a element data? exports.scoreboard:scoreboardAddColumn("EXP") function win(ammo, killer, weapon, bodypart) local H = getElementData(killer, "EXP") local killer1 = getPlayerName(killer) local noob = getPlayerName(source) if killer and killer ~=source then setElementData(killer, "EXP", tonumber(H)+1) outputChatBox(killer1 .. "Killed " .. noob .. " and gained +1 EXP", getRootElement(), 255, 255, 0, false) end end addEventHandler("onPlayerWasted", getRootElement(), Win)
-
My bad, I didn't see the event handler, anyway, you're doing it wrong. function checkOnDeath(ammo, killer) if (killer and getElementType(killer) == "player" and killer ~= source) then local kills = tonumber(getElementData(killer,"Zombie kills")) if (not kills) then setElementData(killer, "Zombie kills", 0) kills = 0 end if (kills <= 24) then spawnPlayer ( killer, 839, -1375, -0.3, 90.0, 0 ) elseif (kills >= 25 and kills <= 49) then elseif (kills >= 35 and kills <=49) then elseif (kills >= 50 and kills <=149) then elseif (kills >= 150 and kills <=349) then elseif (kills >= 350 and kills <=499) then elseif (kills >= 500 and kills <=899) then elseif (kills >= 900 ) then end end end addEventHandler("onPlayerWasted", root, checkOnDeath)
-
Show us how do you use the checkOnDeath function.
-
function clear(player) if hasObjectPermissionTo(player, "function.setPlayerMuted", false) then -- We check if the player has permission to use the function "setPlayerMuted". for i=1,30 do -- We make a for-loop from 1 to 30, this will output repeat the same thing 30 times. outputChatBox(" ") -- We output a empty chatbox message (the loop will make this output 30 times). end -- We end the for-loop. outputChatBox("* #ff0000INFO:#ffff00ADMIN #00ff00"..getPlayerName(player).." #ffff00CLEARED THE CHAT",root,255,12,15, true) -- We output to chatbox the name of the player who executed the command. else -- If he player doesn't has permission to use the function "setPlayerMuted". outputChatBox ("You are Not Admin", player, 193, 13, 13) -- We output to the player who executed the command that he/she is not an admin. end end addCommandHandler("cc", clear)
-
Vehicle that are stored in a map file has these element data.
-
Kenix, he asked without using colshapes, but anyway, I guess he may use it .
-
Remi-X, at least the script himself works fine, wrong indentation doesn't kill people, does it?
-
Why don't you want to use a colshape? what's wrong with them?
-
You're welcome .
-
See? you was able to do it, maybe you needed some more motivation . You're welcome
-
Today I've reached my post number 5000! Let the party begin!
-
You're welcome.
-
function setposOnLogin() local playerTeam = getPlayerTeam(source) -- This was missing. if (not playerTeam) then return end local teamName = getTeamName(playerTeam) if (teamName == "Subway Clan(2)") then spawnPlayer(...ect) end -- this was missing. end addEventHandler("onPlayerLogin", getRootElement(), setposOnLogin)
-
Your best chance is editing the resource "interiors", it's really simple to achieve this with some experience.
