Hey, I have just started learning some basic lua coding and stuff like that. I run a darkrp server and i would like to add trails that players could buy in their entities menu like where the money printer is. I found some code online and edited it a little bit, but this just makes it so the players spawn with a trail, if you code give me some code that i could add to make people be able to buy perm. trails that would be GREATLY appreciated just so you can see this is the script im using in the gamemode init.lua file for now until i figure out or someone helps me with the buyable trails!
hook.Add("PlayerSpawn", "AddTrails", function(pl)
pl.Trail = util.SpriteTrail(pl, 0, Color(255,102,0,255), false, 15, 1, 4, 1/(15+1)*0.5, "trails/plasma.vmt", "trails/litfuse.vmt", "trails/rainbow.vmt", "trails/carebear.vmt", "trails/happy.vmt", "trails/dennis.vmt", "trails/wots.vmt", "trails/epiclulz.vmt", "trails/ben.vmt", "trails/smouch.vmt", "trails/arrow.vmt", "trails/star.vmt", "trails/angry.vmt", "trails/handy.vmt")
end)
hook.Add("PlayerDisconnect", "RemoveTrails", function(pl)
SafeRemoveEntity(pl.Trail)
end)
Read up on derma & sqlite.
wiki.garrysmod.com
[QUOTE=Nexus435;25428012]Read up on derma & sqlite.
wiki.garrysmod.com[/QUOTE]
I have tried its to confusing, im just asking for a some code
assuming this is a serverside thing
does this attach random trails on people? Surely your not adding all of them to a player...
Let me toy with it and i will update this post with something working soon.
[QUOTE=melindagreen;25430480]assuming this is a serverside thing
does this attach random trails on people? Surely your not adding all of them to a player...
Let me toy with it and i will update this post with something working soon.[/QUOTE]
I wanted to make it so they could buy different trails from the shop menu in darkrp (like where u would buy a moneyprinter) like on sassilization servers also like hats that players could wear if you could add that to it, thanks alot btw.
ah oko because there are several ways to do this.
SO i will have to look in the darkrp stuff then
[editline]15th October 2010[/editline]
ok i am thinking your add something like this:
[code]
AddEffects("Plasma Trail", "trails/plasma.vmt", 100, 2, "/buyplasmatrail")
AddEffects("Lit Fuse Trail", "trails/litfuse.vmt", 100, 2, "/buylitfusetrail")
AddEffects("Rainbow Trail", "trails/rainbow.vmt", 100, 2, "/buyrainbowtrail")
AddEffects("carebear Trail", "trails/carebear.vmt", 100, 2, "/buycarebeartrail")
AddEffects("Happy Trail", "trails/happy.vmt", 100, 2, "/buyhappytrail")
AddEffects("Dennis Trail", "trails/dennis.vmt", 100, 2, "/buydennistrail")
AddEffects("Wots Trail", "trails/wots.vmt", 100, 2, "/buywotstrail")
AddEffects("Epic Lulz Trail", "trails/epiclulz.vmt", 100, 2, "/buyepiclulztrail")
Addffects("Ben Trail", "trails/epiclulz.vmt", 100, 2, "/buyepiclulztrail")
Addffects("Smouch Trail", "trails/smouch.vmt", 100, 2, "/buysmouchtrail")
Addffects("Arrow Trail", "trails/arrow.vmt", 100, 2, "/buyarrowtrail")
Addffects("Starz Trail", "trails/star.vmt", 100, 2, "/buystartrail")
Addffects("Angry Trail", "trails/angry.vmt", 100, 2, "/buyangrytrail")
Addffects("Handy Trail", "trails/handy.vmt", 100, 2, "/buyhandytrail")
[/code]
in your addentities.lua file
don't quote me on that though as i don't do aolt of darkrp stuff
if its not right someone please correct it
[QUOTE=melindagreen;25431548]ah oko because there are several ways to do this.
SO i will have to look in the darkrp stuff then
[editline]15th October 2010[/editline]
ok i am thinking your add something like this:
[code]
AddEffects("Plasma Trail", "trails/plasma.vmt", 100, 2, "/buyplasmatrail")
AddEffects("Lit Fuse Trail", "trails/litfuse.vmt", 100, 2, "/buylitfusetrail")
AddEffects("Rainbow Trail", "trails/rainbow.vmt", 100, 2, "/buyrainbowtrail")
AddEffects("carebear Trail", "trails/carebear.vmt", 100, 2, "/buycarebeartrail")
AddEffects("Happy Trail", "trails/happy.vmt", 100, 2, "/buyhappytrail")
AddEffects("Dennis Trail", "trails/dennis.vmt", 100, 2, "/buydennistrail")
AddEffects("Wots Trail", "trails/wots.vmt", 100, 2, "/buywotstrail")
AddEffects("Epic Lulz Trail", "trails/epiclulz.vmt", 100, 2, "/buyepiclulztrail")
Addffects("Ben Trail", "trails/epiclulz.vmt", 100, 2, "/buyepiclulztrail")
Addffects("Smouch Trail", "trails/smouch.vmt", 100, 2, "/buysmouchtrail")
Addffects("Arrow Trail", "trails/arrow.vmt", 100, 2, "/buyarrowtrail")
Addffects("Starz Trail", "trails/star.vmt", 100, 2, "/buystartrail")
Addffects("Angry Trail", "trails/angry.vmt", 100, 2, "/buyangrytrail")
Addffects("Handy Trail", "trails/handy.vmt", 100, 2, "/buyhandytrail")
[/code]
in your addentities.lua file
don't quote me on that though as i don't do aolt of darkrp stuff
if its not right someone please correct it[/QUOTE]
Well thanks for getting back to me so fast :) but im not sure if that would work, im trying to make it so that it adds the trails to the people, also for darkrp i dont THINK you can do that, ill go test it and come back after to see if it works though
[editline]16th October 2010[/editline]
Um, yeh the "Addeffect" does not work for darkrp... and not to be rude or mean but the whole thing u just gave me doesnt work, :P, so if you could try to come up with some dif code or if someone else knows...
Why not learn for yourself and gain satisfaction?
[QUOTE=Xenus;25438005]Why not learn for yourself and gain satisfaction?[/QUOTE]
Well im very busy with schoolwork and truthfully I don't have the time
There is a function that creates trails, I did this for a shop a while ago. Look on the wiki, it's something like util.CreateSpriteTrail()
Again, I don't have a lot of free time, so If you could post the actual code that would be helpful O_O
Sorry I don't mess with darkrp stuff. I went off the file they had in the gamemode.
They have store mods out there that you can add trails to so people can buy them
Anyone that knows how to code lua, if you could help that would be greatly appreciated.
please someone respond
[highlight](User was banned for this post ("Bump" - mahalis))[/highlight]
do it yourself
seems you have enough time to beg
[highlight](User was banned for this post ("Why reply?" - mahalis))[/highlight]
[QUOTE=karrotman29;25600265]please someone respond[/QUOTE]
Ever thought about posting in the request section?
By posting in the main lua section you scream out "Look at me I can't read shit".
Seriously.
Sorry, you need to Log In to post a reply to this thread.