[Release] Lua Scripting
-
This kind of support is great because it can give a lot more options to those who create servers.
Great work, great release -
ill try to make a damage counter like repz gungame servers on iw4x
-
Xx_Phoenix_xX i think this is what you mean
game:onplayerdamage(function(_self, inflictor, attacker, damage, dflags, mod, weapon, point, dir, hitloc) if (game:isplayer(attacker) ~= 1 or _self.sessionteam == attacker.sessionteam or _self == attacker) then return end local huddamage = game:newclienthudelem(attacker) huddamage.alignx = "center" huddamage.horzalign = "center" huddamage.x = 10 huddamage.y = 235 huddamage.fontscale = 1.6 huddamage.font = "objective" huddamage:setvalue(damage) if (hitloc == "head") then huddamage.color = vector:new(1, 1, 0.25) end huddamage:moveovertime(1) huddamage:fadeovertime(1) huddamage.alpha = 0 huddamage.x = math.random(25, 70) huddamage.y = 235 + math.random(25, 70) * (math.random(0, 1) == 1 and -1 or 1) game:ontimeout(function() huddamage:destroy() end, 1000) end)
-
Just a question: I don't know how to program, but with this Lua script is it possible to make smart bots (since it's impossible to make with the current chaiscript) ?
-
Xedi yes
-
good job! finally see something good for mw3..
-
Rosamaha Still won't allow you to set blocked commands on clients
-
Xerxes good that gsc support comes soon ^^ sadly I stopped playing mw3 atm
-
good release
-
fed so how do i implement this on my game?
-
Put that in a file like
Plutonium/storage/iw5/scripts/yourscript/__init__.lua
-
fed does it work on all servers or only my own? btw nice gungame server its lots of fun
-
fed It doesn't seem to work for me. I did the Damage Counter Script you made in the above comments. But It never worked, I neither know how to run it. (if you have to run it manually) Any Help?
-
@ScottieC111
1 - Copy the plugin toPlutonium/storage/iw5/plugins/
2 - Create a file inPlutonium/storage/iw5/scripts/yourscript/__init__.lua
and copy the code into it
3 - Run the server -
Looks like a great addition, I'll install Pluto IW5 to try this out.
I didn't notice any issues or development plan on GitHub. Looking forward to contributing to it.
-
fed Thank you for adding the lua support. I've been trying to get
hasperk
andunsetperk
to work but it seem it crash the server upon loading the script every time.function onPlayerSpawned( player ) if(player:haspek("specialty_grenadepulldeath")) then print(player.name .. " is using marty") end end function onPlayerConnected( player ) local spawnListener = player:onnotify("spawned_player", function() onPlayerSpawned(player) end) end level:onnotify("connected", onPlayerConnected)
-
st0rm not sure why it crashes but doing this works fine:
function onPlayerSpawned( player ) game:ontimeout(function() if(player:hasperk("specialty_grenadepulldeath") == 1) then print(player.name .. " is using marty") end end, 0) end function onPlayerConnected( player ) local spawnListener = player:onnotify("spawned_player", function() onPlayerSpawned(player) end) end level:onnotify("connected", onPlayerConnected)
-
Thanks Fed. That work just fine. I learnt the hard way the mw3 sets death perks in a really dumb way where there is not way to unset them since they're based on death streaks.
-
fed I am trying to upload the plugin to the server, but I am getting the following error:
-
st0rm And regarding this, I don't know what you want to achieve, but if it works for you, in GSC I use this to deactivate the death streaks
onPlayerKilled() { self endon("disconnect"); level endon("game_ended"); for(;;) { self waittill("killed_player"); self.pers["cur_death_streak"] = 0; //Stop deathstreak } }