Unknown error which I couldn't find an answer about

I’ve made an Admin system that worked perfecly for my name, and suddenly it gives an error I couldn’t know why I even looked online but didnt find a solution, the crazy part is that it works flawlessly in studio, the error is


this is the admin panel code:

local admins = {1120353420,-1,-2,-3}

local function GetPlayer(name: string): Player | nil
	name = name:lower()
	for _, player in ipairs(game:GetService("Players"):GetPlayers()) do
		if name == player.Name:lower():sub(1, #name) then
			return player
		end
	end
	return nil
end

local function giveaura(name: string,char)
	for _,v in char:GetDescendants() do
		if v:HasTag("Delete") then
			v:Destroy()
		end
	end
	name = name:lower()
	char:FindFirstChild("Humanoid").WalkSpeed = 16
	char:FindFirstChild("Animate").walk.WalkAnim.AnimationId = "http://www.roblox.com/asset/?id=180426354"
	if name == "auraless" then
		game:GetService("ServerStorage").Auras.Auraless.VFX:Clone().Parent = char:FindFirstChild("Torso")
		game:GetService("ServerStorage").Auras.Auraless.Title:Clone().Parent = char:FindFirstChild("HumanoidRootPart")
	elseif name == "greenweilder" then
		game:GetService("ServerStorage").Auras["Green Weilder"].VFX:Clone().Parent = char:FindFirstChild("Left Arm")
		game:GetService("ServerStorage").Auras["Green Weilder"].VFX:Clone().Parent = char:FindFirstChild("Right Arm")
		game:GetService("ServerStorage").Auras["Green Weilder"].Title:Clone().Parent = char:FindFirstChild("HumanoidRootPart")
	elseif name == "thespeedster" then
		game:GetService("ServerStorage").Auras["The Speedster"].TVFX:Clone().Parent = char:FindFirstChild("Torso")
		game:GetService("ServerStorage").Auras["The Speedster"].Title:Clone().Parent = char:FindFirstChild("HumanoidRootPart")
		for _,v in game:GetService("ServerStorage").Auras["The Speedster"].Arms:GetChildren() do
			v:Clone().Parent = char:FindFirstChild("Left Arm")
		end
		for _,v in game:GetService("ServerStorage").Auras["The Speedster"].Arms:GetChildren() do
			v:Clone().Parent = char:FindFirstChild("Right Arm")
		end
		char:FindFirstChild("Right Arm").Trail.Attachment0 = char:FindFirstChild("Right Arm").Up
		char:FindFirstChild("Right Arm").Trail.Attachment1 = char:FindFirstChild("Right Arm").Down

		char:FindFirstChild("Left Arm").Trail.Attachment0 = char:FindFirstChild("Left Arm").Up
		char:FindFirstChild("Left Arm").Trail.Attachment1 = char:FindFirstChild("Left Arm").Down

		char:FindFirstChild("Humanoid").WalkSpeed = 35
		char:FindFirstChild("Animate").walk.WalkAnim.AnimationId = "rbxassetid://99262205380695"
	elseif name == "windmaster" then
		game:GetService("ServerStorage").Auras["Wind Master"].Twirl:Clone().Parent = char:FindFirstChild("Torso")
		game:GetService("ServerStorage").Auras["Wind Master"].Title:Clone().Parent = char:FindFirstChild("HumanoidRootPart")
		game:GetService("ServerStorage").Auras["Wind Master"].FWOOSH:Clone().Parent = char:FindFirstChild("Right Leg")
		game:GetService("ServerStorage").Auras["Wind Master"].FWOOSH:Clone().Parent = char:FindFirstChild("Left Leg")
		game:GetService("ServerStorage").Auras["Wind Master"].LINES:Clone().Parent = char:FindFirstChild("Right Leg")
		game:GetService("ServerStorage").Auras["Wind Master"].LINES:Clone().Parent = char:FindFirstChild("Left Leg")
	elseif name == "beatmaster" then
		game:GetService("ServerStorage").Auras["Beat Master"].SetUp:Clone().Parent = char
		char.SetUp.Enabled = true
	elseif name == "jackpot" then
		game:GetService("ServerStorage").Auras["JACKPOT!!"].Title:Clone().Parent = char:FindFirstChild("HumanoidRootPart")
		for _,v in game:GetService("ServerStorage").Auras["JACKPOT!!"].VFX.HRP:GetChildren() do
			v:Clone().Parent = char:FindFirstChild("HumanoidRootPart")
		end
		char:FindFirstChild("HumanoidRootPart").Domain.Position = char:FindFirstChild("HumanoidRootPart").Position - Vector3.new(0,2.9,0)
		char:FindFirstChild("HumanoidRootPart").GroundPart.Position = char:FindFirstChild("HumanoidRootPart").Position - Vector3.new(0,2.9,0)
		char:FindFirstChild("HumanoidRootPart").WeldConstraint1.Part0 = char:FindFirstChild("HumanoidRootPart")
		char:FindFirstChild("HumanoidRootPart").WeldConstraint1.Part1 = char:FindFirstChild("HumanoidRootPart").GroundPart
		char:FindFirstChild("HumanoidRootPart").WeldConstraint.Part0 = char:FindFirstChild("HumanoidRootPart")
		char:FindFirstChild("HumanoidRootPart").WeldConstraint.Part1 = char:FindFirstChild("HumanoidRootPart").Domain
		char:FindFirstChild("HumanoidRootPart").Domain.Anchored = false
		char:FindFirstChild("HumanoidRootPart").GroundPart.Anchored = false
		for _,v in game:GetService("ServerStorage").Auras["JACKPOT!!"].VFX.H:GetChildren() do
			v:Clone().Parent = char:FindFirstChild("Head")
		end
		game:GetService("ServerStorage").Auras["JACKPOT!!"].Startup:Clone().Parent = char
		char.Startup.Enabled = true
	else
		return false
	end
end

game:GetService("Players").PlayerAdded:Connect(function(plr) --game:GetService("ReplicatedStorage").SendNotification:FireClient(player,message,is an admin message,is an error)
	pcall(function()
		if table.find(admins,plr.UserId) then
			plr.Chatted:Connect(function(msg)
				pcall(function()
					local com = string.split(msg," ")
					for _,v in com do
						if v == "" then
							table.remove(com,table.find(com,v))
						end
					end
					if com[1] == "/e" and com[2] then
						com[2] = com[2]:lower()
						if com[2] == "notify" then
							if com[3] then
								if com[3] == "all" then
									for _,v in game:GetService("Players"):GetPlayers() do
										pcall(function()
											game:GetService("ReplicatedStorage").SendNotification:FireClient(v, msg:gsub(com[3],""):gsub(com[2],""):gsub(com[1],""),false,false)
											game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Command executed successfully",true,false)
										end)
									end
									return
								end
								if com[4] then
									local target = GetPlayer(com[3])
									if target then
										pcall(function()
											game:GetService("ReplicatedStorage").SendNotification:FireClient(target, msg:gsub(com[3],""):gsub(com[2],""):gsub(com[1],""),false,false)
											game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Command executed successfully",true,false)
										end)
									else
										game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Couldn't find player",true,true)
									end
								else
									game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Please provide a message",true,true)
								end
							else
								game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Please provide a player",true,true)
							end
						elseif com[2] == "kick" then
							if com[3] then
								if com[3] == "all" then
									for _,v in game:GetService("Players"):GetPlayers() do
										pcall(function()
											if com[4] then
												v:Kick(msg:gsub(com[3],""):gsub(com[2],""):gsub(com[1],""))
											else
												v:Kick()
											end
											game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Command executed successfully",true,false)
										end)
									end
									return
								end
								local target = GetPlayer(com[3])
								if target then
									pcall(function()
										if com[4] then
											target:Kick(msg:gsub(com[3],""):gsub(com[2],""):gsub(com[1],""))
										else
											target:Kick()
										end
										game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Command executed successfully",true,false)
									end)
								else
									game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Couldn't find player",true,true)
								end
							else
								game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Please provide a player",true,true)
							end
						elseif com[2] == "kill" then
							if com[3] then
								if com[3] == "all" then
									for _,v in game:GetService("Players"):GetPlayers() do
										if v.Character:HasTag("Immunity") then
											game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Player has immunity",true,true)
											continue
										end
										pcall(function()
											v.Character.Humanoid.Health = 0
											game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Command executed successfully",true,false)
										end)
									end
									return
								end
								local target = GetPlayer(com[3])
								if target then
									if target.Character:HasTag("Immunity") then
										game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Player has immunity",true,true)
										return
									end
									pcall(function()
										target.Character.Humanoid.Health = 0
										game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Command executed successfully",true,false)
									end)
								else
									game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Couldn't find player",true,true)
								end
							else
								game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Please provide a player",true,true)
							end
						elseif com[2] == "heal" then
							if com[3] then
								if com[3] == "all" then
									for _,v in game:GetService("Players"):GetPlayers() do
										pcall(function() 
											if com[4] then
												if tonumber(com[4]) then
													if tonumber(com[4]) > 100 or tonumber(com[4]) < 1 then
														game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Provide a number from 1 to 100",true,true)
														return
													end
													v.Character.Humanoid.Health += (v.Character.Humanoid.MaxHealth / 100) * tonumber(com[4])
												else
													v.Character.Humanoid.Health = v.Character.Humanoid.MaxHealth
												end
											else
												v.Character.Humanoid.Health = v.Character.Humanoid.MaxHealth
											end
											game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Command executed successfully",true,false)
										end)
									end
									return
								end
								local target = GetPlayer(com[3])
								if target then
									pcall(function() 
										if com[4] then
											if tonumber(com[4]) then
												if tonumber(com[4]) > 100 or tonumber(com[4]) < 1 then
													game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Provide a number from 1 to 100",true,true)
													return
												end
												target.Character.Humanoid.Health += (target.Character.Humanoid.MaxHealth / 100) * tonumber(com[4])
											else
												target.Character.Humanoid.Health = target.Character.Humanoid.MaxHealth
											end
										else
											target.Character.Humanoid.Health = target.Character.Humanoid.MaxHealth
										end
										game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Command executed successfully",true,false)
									end)
								else
									game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Couldn't find player",true,true)
								end
							else
								game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Please provide a player",true,true)
							end
						elseif com[2] == "dmg" then
							if com[3] then
								if com[3] == "all" then
									for _,v in game:GetService("Players"):GetPlayers() do
										if v.Character:HasTag("Immunity") then
											game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Player has immunity",true,true)
											continue
										end
										pcall(function()
											if com[4] then
												if tonumber(com[4]) then
													if tonumber(com[4]) > 100 or tonumber(com[4]) < 1 then
														game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Provide a number from 1 to 100",true,true)
														return
													end
													v.Character.Humanoid.Health = (v.Character.Humanoid.MaxHealth / 100) * tonumber(com[4])
												end
											else
												game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Provide a number from 1 to 100",true,true)
											end
											game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Command executed successfully",true,false)
										end)
									end
									return
								end
								local target = GetPlayer(com[3])
								if target then
									if target.Character:HasTag("Immunity") then
										game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Player has immunity",true,true)
										return
									end
									pcall(function()
										if com[4] then
											if tonumber(com[4]) then
												if tonumber(com[4]) > 100 or tonumber(com[4]) < 1 then
													game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Provide a number from 1 to 100",true,true)
													return
												end
												target.Character.Humanoid.Health = (target.Character.Humanoid.MaxHealth / 100) * tonumber(com[4])
											end
										else
											game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Provide a number from 1 to 100",true,true)
										end
										game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Command executed successfully",true,false)
									end)
								else
									game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Couldn't find player",true,true)
								end
							else
								game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Please provide a player",true,true)
							end
						elseif com[2] == "luck" then
							if com[3] then
								if com[3] == "all" then
									for _,v in game:GetService("Players"):GetPlayers() do
										pcall(function()
											if tonumber(com[4]) then
												v.Character:SetAttribute("Multiplier", tonumber(com[4]))
												game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Command executed successfully",true,false)
											else
												game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Provide a number",true,true)
											end
										end)
									end
									return
								end
								local target = GetPlayer(com[3])
								if target then
									pcall(function()
										if tonumber(com[4]) then
											target.Character:SetAttribute("Multiplier", tonumber(com[4]))
											game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Command executed successfully",true,false)
										else
											game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Provide a number",true,true)
										end
									end)
								else
									game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Couldn't find player",true,true)
								end
							else
								game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Please provide a player",true,true)
							end
						elseif com[2] == "give" then
							if com[3] then
								local target = GetPlayer(com[3])
								if target then
									if com[4] then
										pcall(function()
											local success = giveaura(com[4],target.Character)
											if success == false then
												game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Provide a valid aura",true,true)
											else
												game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Command executed successfully",true,false)
											end
										end)
									else
										game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Provide an aura",true,true)
									end

								else
									game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Couldn't find player",true,true)
								end
							else
								game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Please provide a player",true,true)
							end
						elseif com[2] == "nocd" then
							if com[3] then
								if com[3] == "all" then
									for _,v in game:GetService("Players"):GetPlayers() do
										local tchar = v.Character or v.CharacterAdded:Wait()
										if tchar:HasTag("NoCD") then
											tchar:RemoveTag("NoCD")
											game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Added "..v.Name.."'s roll cooldown",true,false)
										else
											tchar:AddTag("NoCD")
											game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Removed "..v.Name.."'s roll cooldown",true,false)
										end
									end
									return
								end
								local target = GetPlayer(com[3])
								if target then
									local tchar = target.Character or target.CharacterAdded:Wait()
									if tchar:HasTag("NoCD") then
										tchar:RemoveTag("NoCD")
										game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Added "..target.Name.."'s roll cooldown",true,false)
									else
										tchar:AddTag("NoCD")
										game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Removed "..target.Name.."'s roll cooldown",true,false)
									end
								else
									game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Couldn't find player",true,true)
								end
							else
								game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Please provide a player",true,true)
							end
						elseif com[2] == "setcd" then
							if com[3] then
								if tonumber(com[4]) then
									if com[3] == "all" then
										for _,v in game:GetService("Players"):GetPlayers() do
											local tchar = v.Character or v.CharacterAdded:Wait()
											if tchar then
												tchar:SetAttribute("CD",tonumber(com[4]))
												game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Set "..v.Name.."'s roll cooldown to ".. com[4].."s with success",true,false)
											end
										end
										return
									end
									local target = GetPlayer(com[3])
									if target then
										local tchar = target.Character or target.CharacterAdded:Wait()
										if tchar then
											tchar:SetAttribute("CD",tonumber(com[4]))
											game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Set "..target.Name.."'s roll cooldown to ".. com[4].."s with success",true,false)
										end
									else
										game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Couldn't find player",true,true)
									end
								else
									game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Provide a valid number",true,true)
								end
							else
								game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Please provide a player",true,true)
							end
						elseif com[2] == "freeze" then
							if com[3] then
								if com[3] == "all" then
									for _,v in game:GetService("Players"):GetPlayers() do
										local tchar = v.Character or v.CharacterAdded:Wait()
										tchar:FindFirstChild("HumanoidRootPart").Anchored = not tchar:FindFirstChild("HumanoidRootPart").Anchored
										if tchar:FindFirstChild("HumanoidRootPart").Anchored then
											game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Froze "..v.Name.." with success",true,false)
										else
											game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Unfroze "..v.Name.." with success",true,false)
										end
									end
									return
								end
								local target = GetPlayer(com[3])
								if target then
									local tchar = target.Character or target.CharacterAdded:Wait()
									tchar:FindFirstChild("HumanoidRootPart").Anchored = not tchar:FindFirstChild("HumanoidRootPart").Anchored
									if tchar:FindFirstChild("HumanoidRootPart").Anchored then
										game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Froze "..target.Name.." with success",true,false)
									else
										game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Unfroze "..target.Name.." with success",true,false)
									end
								else
									game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Couldn't find player",true,true)
								end
							else
								game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Please provide a player",true,true)
							end
						elseif com[2] == "sky" then
							if com[3] then
								if tonumber(com[4]) then
									if com[3] == "all" then
										for _,v in game:GetService("Players"):GetPlayers() do
											local tchar = v.Character or v.CharacterAdded:Wait()
											if tchar then
												tchar:PivotTo(tchar.PrimaryPart.CFrame + Vector3.new(0,tonumber(com[4]),0))
												game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Elevated "..v.Name.." "..com[4].." studs high with success",true,false)
											end
										end
										return
									end
									local target = GetPlayer(com[3])
									if target then
										local tchar = target.Character or target.CharacterAdded:Wait()
										if tchar then
											tchar:PivotTo(tchar.PrimaryPart.CFrame + Vector3.new(0,tonumber(com[4]),0))
											game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Elevated "..target.Name.." "..com[4].." studs high with success",true,false)
										end
									else
										game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Couldn't find player",true,true)
									end
								else
									game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Provide a valid number",true,true)
								end
							else
								game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Please provide a player",true,true)
							end
						elseif com[2] == "tp" then
							if com[3] then
								local target = GetPlayer(com[3])
								if target then
									local tchar = target.Character or target.CharacterAdded:Wait()
									local char = plr.Character or plr.CharacterAdded:Wait()
									char:PivotTo(tchar.PrimaryPart.CFrame)
									game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Teleported to "..target.Name.." with success",true,false)
								else
									game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Couldn't find player",true,true)
								end
							else
								game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Please provide a player",true,true)
							end
						elseif com[2] == "bring" then
							if com[3] then
								if com[3] == "all" then
									for _,v in game:GetService("Players"):GetPlayers() do
										local tchar = v.Character or v.CharacterAdded:Wait()
										local char = plr.Character or plr.CharacterAdded:Wait()
										tchar:PivotTo(char.PrimaryPart.CFrame)
										game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Brought "..v.Name.." with success",true,false)
									end
									return
								end
								local target = GetPlayer(com[3])
								if target then
									local tchar = target.Character or target.CharacterAdded:Wait()
									local char = plr.Character or plr.CharacterAdded:Wait()
									tchar:PivotTo(char.PrimaryPart.CFrame)
									game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Brought "..target.Name.." with success",true,false)
								else
									game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Couldn't find player",true,true)
								end
							else
								game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Please provide a player",true,true)
							end
						elseif com[2] == "chatan" then
							if com[3] then
								pcall(function()
									local msg2 = "<font color = '#d5c700'>[SYSTEM]:"..(msg:gsub(com[2],""):gsub(com[1],"")).."</font>"
									game:GetService("ReplicatedStorage").RareAura:FireAllClients(msg2)
									game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Command executed successfully",true,false)
								end)
							else
								game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Please provide a message",true,true)
							end
						elseif com[2] == "announce" then
							if com[3] then
								pcall(function()
									local msg2 = "<font color = '#df2d0e'>"..plr.DisplayName.. ":</font>"..(msg:gsub(com[2],""):gsub(com[1],""))
									game:GetService("ReplicatedStorage").Announce:FireAllClients(msg2)
									game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Command executed successfully",true,false)
								end)
							else
								game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Please provide a message",true,true)
							end
						elseif com[2] == "setroll" then
							if com[3] then
								if tonumber(com[4]) then
									if com[3] == "all" then
										for _,v in game:GetService("Players"):GetPlayers() do
											v.leaderstats.Rolls.Value = tonumber(com[4])
											game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Command executed successfully",true,false)
										end
										return
									end
									local target = GetPlayer(com[3])
									if target then
										target.leaderstats.Rolls.Value = tonumber(com[4])
										game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Command executed successfully",true,false)
									else
										game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Couldn't find player",true,true)
									end
								else
									game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Provide a valid number",true,true)
								end
							else
								game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Please provide a player",true,true)
							end
						elseif com[2] == "setcoins" then
							if com[3] then
								if tonumber(com[4]) then
									if com[3] == "all" then
										for _,v in game:GetService("Players"):GetPlayers() do
											v.leaderstats.Coins.Value = tonumber(com[4])
											game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Command executed successfully",true,false)
										end
										return
									end
									local target = GetPlayer(com[3])
									if target then
										target.leaderstats.Coins.Value = tonumber(com[4])
										game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Command executed successfully",true,false)
									else
										game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Couldn't find player",true,true)
									end
								else
									game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Provide a valid number",true,true)
								end
							else
								game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Please provide a player",true,true)
							end
						else
							game:GetService("ReplicatedStorage").SendNotification:FireClient(plr, "Invalid Command",true,true)
						end
					end
				end)
			end)
		end
	end)
end)

I need help since with this error the admin panel dosent work and I can’t test stuff myself

Firstly, the error is caused because you are firing a RemoteEvent on the server, but it is not being listened to on the client.

Secondly, your code is extremely difficult to read with many bad coding practices. For example, you are using pcall incorrectly and calling GetService and FindFirstChild multiple times for the same thing.

Also as a bonus, with many if statements, code becomes long horizontally which is difficult to read. Instead, check for the condition to ignore and continue or return depending on the situation, if possible. Additionally, in regards to the if statements for each command, I would recommend splitting them up in their own functions or modules to keep everything organized.

oh damn sorry ik its kinda messy but the remove events it fires gets then used on the client also ill fix the code removing the many findfirstchild and get services

also here are the local scripts that listen to the 3 remote events the server fires

game.ReplicatedStorage:WaitForChild("RareAura").OnClientEvent:Connect(function(msg)
	if msg then
		game.TextChatService.TextChannels.RBXGeneral:DisplaySystemMessage(msg)
	end
end)
local ts = game:GetService("TweenService")
game.ReplicatedStorage:WaitForChild("Announce").OnClientEvent:Connect(function(msg)
	task.spawn(function()
		local new = script.Parent.Template:Clone()
		new.Parent = script.Parent.Acc
		new.Content.Text = msg
		ts:Create(new.Content,TweenInfo.new(1.5),{TextTransparency = 0}):Play()
		task.wait(7)
		ts:Create(new.Content,TweenInfo.new(1.5),{TextTransparency = 1}):Play()
		task.wait(1.5)
		new:Destroy()
	end)
end)
game.ReplicatedStorage:WaitForChild("SendNotification").OnClientEvent:Connect(function(msg,IsAdmin,errors)
	if IsAdmin then
		pcall(function()
			game.StarterGui:SetCore("SendNotification",{
				Title = "ADMIN",
				Text = msg
			})
			if errors then
				script.Error:Play()
			else
				script.Sound:Play()
			end
		end)
	else
		pcall(function()
			game.StarterGui:SetCore("SendNotification",{
				Title = "NOTIFICATION",
				Text = msg
			})
			script.Sound:Play()
		end)
	end
end)

This error is roblox studio related bug, it’s not coming from your script.

oh… is there a way to fix it or i just need to wait..? i even wrote roblox an email abt this like 5mins ago

You can check this thread, for updates

that is old this is gonna take ages… :pensive_face: ill just scrap this game and make another i guess

ok so apparently this was the issue, in my module script that grabbed data i called a function that it provides to make it simpler, i removed it and it started working XD

(after)

local data = {}
local dt = game:GetService("DataStoreService"):GetDataStore("moduletest2")

function data:SetDefaultData(ID: number)
	if not ID then
		warn("No ID")
		return false
	end
	local success = false
	local count = 0
	local defaultdata = {
		["Rolls"] = 0,
		["Coins"] = 50,
		["RTO"] = 0,
		["Multiplier"] = 1
	}
	repeat
		if not success then
			count += 1
		end
		success = pcall(function()
			dt:SetAsync(ID,defaultdata)
		end)
		task.wait(0.1)
	until count == 5 or success
	if not success then
		warn("Failed to give player default data")
		return false
	end
	warn("Gave player default data")
	return true
end

function data.FetchData(ID: number)
	if not ID then
		warn("No ID")
		return false
	end
	local FetchedData = {}
	local success = false
	local count = 0
	repeat
		if not success then
			count += 1
		end
		success, FetchedData = pcall(function()
			return dt:GetAsync(ID)
		end)
		task.wait(0.1)
	until count == 5 or success
	if not success then
		warn("Failed to fetch player data")
		return false
	end
	warn("Fetched player data")
	return FetchedData
end

function data:UpdateData(ID: number,NewData: {})
	if not ID or not NewData then
		warn("No ID or Data")
		return false
	end
	local success = false
	local count = 0
	repeat
		if not success then
			count += 1
		end
		success = pcall(function()
			dt:SetAsync(ID,NewData)
		end)
		task.wait(0.1)
	until count == 5 or success
	if not success then
		warn("Failed to update player data")
		return false
	end
	warn("Updated player data")
	return true
end

function data:AddNewVariable(ID: number,NewVariableName: string, NewVariableValue)
	if not ID or not NewVariableName or not NewVariableValue then
		warn("Failed")
		return false
	end
	local Currdata = {}
	local success = false
	local count = 0
	repeat
		if not success then
			count += 1
		end
		success, Currdata = pcall(function()
			return dt:GetAsync(ID)
		end)
		task.wait(0.1)
	until count == 5 or success
	if not success then
		warn("Failed to fetch player data")
		return false
	end
	warn("Fetched player data")
	if Currdata[NewVariableName] then
		warn("Variable already exists")
		return
	end
	Currdata[NewVariableName] = NewVariableValue
	local success = false
	local count = 0
	repeat
		if not success then
			count += 1
		end
		success = pcall(function()
			dt:SetAsync(ID,Currdata)
		end)
		task.wait(0.1)
	until count == 5 or success
	if not success then
		warn("Failed to add value to player data")
		return false
	end
	warn("Added value to player data")
	return true
end

return data

(before)

local dt = game:GetService("DataStoreService"):GetDataStore("moduletest2")

function data:SetDefaultData(ID: number)
	if not ID then
		warn("No ID")
		return false
	end
	local success = false
	local count = 0
	local defaultdata = {
		["Rolls"] = 0,
		["Coins"] = 50,
		["RTO"] = 0,
		["Multiplier"] = 1
	}
	repeat
		if not success then
			count += 1
		end
		success = pcall(function()
			dt:SetAsync(ID,defaultdata)
		end)
		task.wait(0.1)
	until count == 5 or success
	if not success then
		warn("Failed to give player default data")
		return false
	end
	warn("Gave player default data")
	return true
end

function data.FetchData(ID: number)
	if not ID then
		warn("No ID")
		return false
	end
	local FetchedData = {}
	local success = false
	local count = 0
	repeat
		if not success then
			count += 1
		end
		success, FetchedData = pcall(function()
			return dt:GetAsync(ID)
		end)
		task.wait(0.1)
	until count == 5 or success
	if not success then
		warn("Failed to fetch player data")
		return false
	end
	warn("Fetched player data")
	return FetchedData
end

function data:UpdateData(ID: number,NewData: {})
	if not ID or not NewData then
		warn("No ID or Data")
		return false
	end
	local success = false
	local count = 0
	repeat
		if not success then
			count += 1
		end
		success = pcall(function()
			dt:SetAsync(ID,NewData)
		end)
		task.wait(0.1)
	until count == 5 or success
	if not success then
		warn("Failed to update player data")
		return false
	end
	warn("Updated player data")
	return true
end

function data:AddNewVariable(ID: number,NewVariableName: string, NewVariableValue)
	if not ID or not NewVariableName or not NewVariableValue then
		warn("Failed")
		return false
	end
	local Currdata = data.FetchData(ID)
	if Currdata[NewVariableName] then
		warn("Variable already exists")
		return
	end
	Currdata[NewVariableName] = NewVariableValue
	local success = false
	local count = 0
	repeat
		if not success then
			count += 1
		end
		success = pcall(function()
			dt:SetAsync(ID,Currdata)
		end)
		task.wait(0.1)
	until count == 5 or success
	if not success then
		warn("Failed to add value to player data")
		return false
	end
	warn("Added value to player data")
	return true
end