• Error in code? Please help!
    6 replies, posted
Hi, So, I was editing pointshop, and it gave me an error on sh_items.lua (line 28) I can't find what the hell I did wrong. Could you guys please take a look? [CODE]POINTSHOP.Items = { [1] = { Name = "Hats, Heads, and Masks", Icon = "emoticon_smile", Enabled = true, NumAllowedItems = 1, Items = { MelonHead = { Name = "Melon Head", Enabled = true, Description = "Gives you a melon head.", Cost = 100, Model = "models/props_junk/watermelon01.mdl", Functions = { OnGive = function(ply, item) item.Hooks.PlayerSpawn(ply, item) end, OnTake = function(ply, item) if ply.Hat then ply.Hat:Remove() end end, ModifyHat = function(ent, pos, ang) pos = pos + (ang:Forward() * -2) return ent, {Pos = pos, Ang = ang} end, }, [B] -- This is line 28 :\[/B] Hooks = { PlayerSpawn = function(ply, item) ply.Hat = ents.Create("pointshop_hat") ply.Hat:SetupHat(ply, item) end, PlayerDeath = function(ply, item) if ply.Hat and ply.Hat:IsValid() then ply.Hat:Remove() end end } }, TurtleHat = { Name = "Turtle Hat", Enabled = true, GvipOnly = true, Description = "Gives you a turtle hat.", Cost = 100, Model = "models/props/de_tides/Vending_turtle.mdl", Functions = { OnGive = function(ply, item) item.Hooks.PlayerSpawn(ply, item) end, OnTake = function(ply, item) if ply.Hat then ply.Hat:Remove() end end, ModifyHat = function(ent, pos, ang) pos = pos + (ang:Forward() * -3) ang:RotateAroundAxis(ang:Up(), -90) return ent, {Pos = pos, Ang = ang} end, }, Hooks = { PlayerSpawn = function(ply, item) ply.Hat = ents.Create("pointshop_hat") ply.Hat:SetupHat(ply, item) end, PlayerDeath = function(ply, item) if ply.Hat and ply.Hat:IsValid() then ply.Hat:Remove() end end } }, SnowmanHead = { Name = "Snowman Head", Enabled = true, GvipOnly = true, Description = "Gives you a snowman head.", Cost = 200, Model = "models/props/cs_office/Snowman_face.mdl", Functions = { OnGive = function(ply, item) item.Hooks.PlayerSpawn(ply, item) end, OnTake = function(ply, item) if ply.Hat then ply.Hat:Remove() end end, ModifyHat = function(ent, pos, ang) pos = pos + (ang:Forward() * -2.2) ang:RotateAroundAxis(ang:Up(), -90) return ent, {Pos = pos, Ang = ang} end, CanPlayerBuy = function(ply) if os.date("%m") == 12 then return true end return false, "it isn't winter yet!" end }, Hooks = { PlayerSpawn = function(ply, item) ply.Hat = ents.Create("pointshop_hat") ply.Hat:SetupHat(ply, item) end, PlayerDeath = function(ply, item) if ply.Hat and ply.Hat:IsValid() then ply.Hat:Remove() end end } }, SpotlightHead = { Name = "Spotlight Head", Enabled = true, Description = "Gives you a spotlight head.", Cost = 100, Model = "models/props_wasteland/light_spotlight01_lamp.mdl", Functions = { OnGive = function(ply, item) item.Hooks.PlayerSpawn(ply, item) end, OnTake = function(ply, item) if ply.Hat then ply.Hat:Remove() end end }, Hooks = { PlayerSpawn = function(ply, item) ply.Hat = ents.Create("pointshop_hat") ply.Hat:SetupHat(ply, item) end, PlayerDeath = function(ply, item) if ply.Hat and ply.Hat:IsValid() then ply.Hat:Remove() end end } }, HeadcrabHat = { Name = "Headcrab Hat", Enabled = true, Description = "Gives you a Headcrab hat.", Cost = 1000, Model = "models/headcrabclassic.mdl", Functions = { OnGive = function(ply, item) item.Hooks.PlayerSpawn(ply, item) end, OnTake = function(ply, item) if ply.Hat then ply.Hat:Remove() end end, ModifyHat = function(ent, pos, ang) ent:SetModelScale(Vector(0.7, 0.7, 0.7)) pos = pos + (ang:Forward() * 2) ang:RotateAroundAxis(ang:Right(), 20) return ent, {Pos = pos, Ang = ang} end, }, Hooks = { PlayerSpawn = function(ply, item) ply.Hat = ents.Create("pointshop_hat") ply.Hat:SetupHat(ply, item) end, PlayerDeath = function(ply, item) if ply.Hat and ply.Hat:IsValid() then ply.Hat:Remove() end end } }, TVHead = { Name = "TV Head", Enabled = true, VipOnly = true, Description = "Gives you a TV head.", Cost = 100, Model = "models/props_c17/tv_monitor01.mdl", Functions = { OnGive = function(ply, item) item.Hooks.PlayerSpawn(ply, item) end, OnTake = function(ply, item) if ply.Hat then ply.Hat:Remove() end end, ModifyHat = function(ent, pos, ang) ent:SetModelScale(Vector(0.8, 0.8, 0.8)) pos = pos + (ang:Right() * -2) + (ang:Forward() * -3) + (ang:Up() * 0.5) return ent, {Pos = pos, Ang = ang} end, }, Hooks = { PlayerSpawn = function(ply, item) ply.Hat = ents.Create("pointshop_hat") ply.Hat:SetupHat(ply, item) end, PlayerDeath = function(ply, item) if ply.Hat and ply.Hat:IsValid() then ply.Hat:Remove() end end } }, LampshadeHat = { Name = "Lampshade Hat", Enabled = true, Description = "Gives you a lampshade hat.", Cost = 100, Model = "models/props_c17/lampShade001a.mdl", Functions = { OnGive = function(ply, item) item.Hooks.PlayerSpawn(ply, item) end, OnTake = function(ply, item) if ply.Hat then ply.Hat:Remove() end end, ModifyHat = function(ent, pos, ang) ent:SetModelScale(Vector(0.7, 0.7, 0.7)) pos = pos + (ang:Forward() * -3.5) + (ang:Up() * 4) ang:RotateAroundAxis(ang:Right(), 10) return ent, {Pos = pos, Ang = ang} end, }, Hooks = { PlayerSpawn = function(ply, item) ply.Hat = ents.Create("pointshop_hat") ply.Hat:SetupHat(ply, item) end, PlayerDeath = function(ply, item) if ply.Hat and ply.Hat:IsValid() then ply.Hat:Remove() end end } }, PanHat = { Name = "Pan Hat", Enabled = true, Description = "Gives you a pan hat.", Cost = 100, Model = "models/props_interiors/pot02a.mdl", Functions = { OnGive = function(ply, item) item.Hooks.PlayerSpawn(ply, item) end, OnTake = function(ply, item) if ply.Hat then ply.Hat:Remove() end end, ModifyHat = function(ent, pos, ang) pos = pos + (ang:Forward() * -3) + (ang:Up() * 2) + (ang:Right() * 5.5) ang:RotateAroundAxis(ang:Right(), 180) return ent, {Pos = pos, Ang = ang} end, }, Hooks = { PlayerSpawn = function(ply, item) ply.Hat = ents.Create("pointshop_hat") ply.Hat:SetupHat(ply, item) end, PlayerDeath = function(ply, item) if ply.Hat and ply.Hat:IsValid() then ply.Hat:Remove() end end } }, NoEntryMask = { Name = "No Entry Mask", Enabled = true, Description = "Gives you a no entry sign mask.", Cost = 50, Model = "models/props_c17/streetsign004f.mdl", Functions = { OnGive = function(ply, item) item.Hooks.PlayerSpawn(ply, item) end, OnTake = function(ply, item) if ply.Hat then ply.Hat:Remove() end end, ModifyHat
Uh, Everything you did is wrong. Look in "pointshop\lua\items"...Unless your using a very old version of pointshop, If so then I have no idea Also, I noticed. Your missing a } on the very end.
I am using the latest pointshop. Where do you want me to look? There is no items folder.
Theres no items folder where sh_items.lua is?
Negative. So, can you tell me why line 28 is bugged?
Because in the latest pointshop, The items folder is where you add items. Also I did show you a syntax error [QUOTE=Netsurfers;36072982]Also, I noticed. Your missing a } on the very end.[/QUOTE]
Got the latest version. Much easier to edit; cheers :D
Sorry, you need to Log In to post a reply to this thread.