Hello, I’m currently making a gamemode and have a question. I am trying to make an entity spawn where the player looks as it will be an entity the player buys.
I have tried looking into other gamemode codes that have this to see IF I could figure it out but I am at a total loss.
Heres the code:
//spawn profitables function BuyBronzePrinter( ply, cmd ) if ply:GetMoney() >= 2000 then ply:TakeMoney( 2000 ) local pos = ply:GetPos() bronze=ents.Create("money_printer_bronze") bronze:SetPos(Vector(_ply:GetEyeTrace().HitPos.x, _ply:GetEyeTrace().HitPos.y, _ply:GetPos().z + 10)) bronze.Owner = ply bronze:SetColor(205, 127, 50, 100 ) bronze:SetRenderMode( RENDERMODE_TRANSALPHA ) bronze:Spawn() ply:ChatPrint("You got a Bronze Printer!") --print "You got a x!" in the chat else ply:ChatPrint("Not enough dosh for that one!") end end concommand.Add("buybronzeprinter", BuyBronzePrinter)
I can not figure this out at all, if one of you could help me It would be greatly appreciated. Thanks!