tinnetju Posted November 6, 2010 Share Posted November 6, 2010 Hello, I wanted to make a little Myth script with a man thats in a train tunnel with MANY many health and a chainsaw. I already got the .txt file and the replace file and that working. The spawn .lua is server sided, but the setpedstat and give weapon stuff is client sided, how do i connect them? And i also can't find how to make him attack you with the chainsaw running (you know, when the chainsaw says HIIIIIIIIIIIIIINNNNGGGG) Here is the client side: txd = engineLoadTXD("126.txd") engineImportTXD(txd, 126) function pedLoad ( pedLoad ) setPedStat( ped,24,2000) setPedStat( ped,164,2000) giveWeapon ( source, 2, 1 ) setPedWeaponSlot ( ped, 1 ) end addEventHandler ( "onResourceStart", getRootElement(), pedLoad ) And here is the server side: createPed ( 126, 871.64227294922, 2720.6179199219, 20.586917877197 ) I debugged it and it says no errors or something, Link to comment
Castillo Posted November 6, 2010 Share Posted November 6, 2010 i recommend you to use "slothbot" by Slothman, you can find it at mta community. maybe editing it you can get it like you want. Link to comment
x86 Posted November 6, 2010 Share Posted November 6, 2010 setPedStat, giveWeapon and onResourceStart are server side thingies. Link to comment
MaddDogg Posted November 6, 2010 Share Posted November 6, 2010 I already got the .txt file and the replace file and that working. What do you mean by that? You can't have giveWeapon client-side, since it's a server-side only function. To move the ped and have him attack, you need setPedControlState. But let me tell you that this is quite a complicated thing to do. You need a client to calcute the ped's movement (like turning into the victims direction and of course running) and the attacking and then sync it to the server. So, you actually have to write a mini AI, which isn't an easy task even for quite good programmers, let alone beginners. And there is also math involved, so you should know your sinus and cosinus. Link to comment
tinnetju Posted November 6, 2010 Author Share Posted November 6, 2010 i recommend you to use "slothbot" by Slothman, you can find it at mta community. maybe editing it you can get it like you want. Ive tried, but i still don't understand why he can use createPed in client! Link to comment
tinnetju Posted November 6, 2010 Author Share Posted November 6, 2010 I already got the .txt file and the replace file and that working. What do you mean by that? You can't have giveWeapon client-side, since it's a server-side only function. To move the ped and have him attack, you need setPedControlState. But let me tell you that this is quite a complicated thing to do. You need a client to calcute the ped's movement (like turning into the victims direction and of course running) and the attacking and then sync it to the server. So, you actually have to write a mini AI, which isn't an easy task even for quite good programmers, let alone beginners. And there is also math involved, so you should know your sinus and cosinus. oowwh soz i ment .txd and to bad its that hard :l Link to comment
dzek (varez) Posted November 6, 2010 Share Posted November 6, 2010 i think you won't do it Link to comment
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