Error at the end of my code with the end)

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I want to fix figure out why this code in erroring at the end)

  2. What is the issue? Include screenshots / videos if possible! theres an error at the end of my code

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub? I tried to fix the error no luck

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local Folder = game.ServerStorage.ToolStorage
-- Officer
local pep = Folder.PepperSpray
local Baton = Folder["Police Baton"]
local cit = Folder["Citation Book"]
local taser = Folder["ER-31X"]
local glock = Folder["Glock 19"]
local handcuffs = Folder.Handcuffs

		if player.TeamColor =="Bronze") then
			if player:GetRankInGroup(10886396) == 1 then --Awaiting Training
				local a = pep:Clone()
				a.Parent = player.Backpack
			else if player:GetRankInGroup(10886396) >= 20 then -- Officer
				local a = glock:Clone()
				a.Parent = player.Backpack
				local b = handcuffs:Clone()
				b.Parent = player.Backpack
				local c = cit:Clone()
				c.Parent = player.Backpack
				local d = taser:Clone()
				d.Parent = player.Backpack
				local e = Baton:Clone()
				e.Parent = player.Backpack
				local f = pep:Clone()
				f.Parent = player.Backpack

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

You forgot a couple of ends

f.Parent = player.Backpack

1 Like

That worked thanks for your help.

1 Like