My Item doesn't delete after I used it

Hey there.

I’m making a battle-game sort of like a RPG one. It’s all going well but when the Uses hit 0 nothing happens!

Im trying to get items with 0 uses or durability to delete themselves to prevent the game from softlocking.

I’m currently trying to figure out if this is a client-issue or a server-issue. I am able to provide scripts if you’d like.

10 Likes

Some scripts would be much appreciated

6 Likes

Here is the main-game client script:

local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SoundService = game:GetService("SoundService")

local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid") or Character:FindFirstChildOfClass("Humanoid")

local PlayerData = Player:WaitForChild("PlayerStatistics")
local PlayerStats = PlayerData:WaitForChild("Statistics")

local Camera = workspace.CurrentCamera
local CurrentArena = workspace:WaitForChild("CurrentArena")

local Folder_Assets = ReplicatedStorage:WaitForChild("Assets")
local Folder_Remotes = Folder_Assets:WaitForChild("Remotes")
local Folder_Events = Folder_Assets:WaitForChild("Events")
local Folder_Modules = Folder_Assets:WaitForChild("Modules")

local TransitionModule = require(Folder_Modules:WaitForChild("RoundTransition"))

local Folder_Models = Folder_Assets:WaitForChild("Models")
local Folder_Items = Folder_Models:WaitForChild("Items")
local Folder_Weapons = Folder_Models:WaitForChild("Weapons")

local SoundTrack = SoundService.SoundTrack

local GUI = script.Parent
local IntroFrame = GUI:WaitForChild("Intro")
local ActionFrame = GUI:WaitForChild("Actions")

--
local Dark1 = IntroFrame:WaitForChild("Darken1")
local Dark2 = IntroFrame:WaitForChild("Darken2")
local Icon = IntroFrame:WaitForChild("Icon")

local Animations = script:WaitForChild("Animations")
local ActionIdle = Humanoid:LoadAnimation(Animations:WaitForChild("ActIdle"))

local ThinkIdle = Humanoid:LoadAnimation(Animations:WaitForChild("ItemIdle"))
--

--
local TurnLabel = ActionFrame:WaitForChild("CurrentTurn")
local TurnTL = TurnLabel:WaitForChild("Team")

local ActInfo = ActionFrame:WaitForChild("Info")
local PlayerFrame = ActInfo:WaitForChild("PlayerFrame")
local EnemyFrame = ActInfo:WaitForChild("EnemyFrame")

local PlayerHP = PlayerFrame:WaitForChild("HP")
local EnemyHP = EnemyFrame:WaitForChild("HP")

local Moves = ActionFrame:WaitForChild("Moves")
local ListOfMoves = Moves:WaitForChild("List")
local TypeOfMoves = Moves:WaitForChild("Types")

local ConfirmMove = ActionFrame:WaitForChild("ConfirmMove")

local WeaponHelp = Moves:WaitForChild("WeaponInfo")
local ItemHelp = Moves:WaitForChild("ItemInfo")

local WeaponsBtn = TypeOfMoves:WaitForChild("Weapons")
local ItemsBtn = TypeOfMoves:WaitForChild("Items")

--

local FastIntroInfo = TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.InOut)
local IntroInfo = TweenInfo.new(1, Enum.EasingStyle.Back, Enum.EasingDirection.InOut)
local LongIntroInfo = TweenInfo.new(2, Enum.EasingStyle.Back, Enum.EasingDirection.InOut)

local ActionInfo = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
local HPInfo = TweenInfo.new(0.3, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)

local CurrentTurn = "Players"
local MoveChosen = false
local ChosenMusic = nil

local function DeclareTurn(Team)

	if not CurrentArena:FindFirstChildOfClass("Folder") then return end

	CurrentTurn = Team
	TurnLabel.TypeOfAlert.Text = "NOTIFICATION"

	if Team == "Players" then
		TurnTL.Text = "It's your turn!"
		TurnLabel.BackgroundColor3 = Color3.fromRGB(42, 152, 255)
		TurnLabel.BorderColor3 = Color3.fromRGB(0, 98, 255)
	elseif Team == "Enemies" then
		TurnTL.Text = "It's their turn!"
		TurnLabel.BackgroundColor3 = Color3.fromRGB(255, 42, 42)
		TurnLabel.BorderColor3 = Color3.fromRGB(141, 0, 0)
	end

	task.spawn(function()
		script.Notification:Play()
		TweenService:Create(TurnLabel, ActionInfo, {Position = UDim2.new(0, 0,0.3, 0)}):Play()	
		task.wait(1.75)
		TweenService:Create(TurnLabel, ActionInfo, {Position = UDim2.new(-1, 0,0.3, 0)}):Play()
	end)

	task.wait(1)
end

local function ClearStuff()
	for _, UI in pairs(ListOfMoves:GetChildren()) do
		if not UI:IsA("UIListLayout") then
			UI:Destroy()
		end
	end
end

local function LoadStuff(Type)
	local FolderOfThings = PlayerData:WaitForChild(Type)
	ClearStuff()

	for _, Thing in pairs(FolderOfThings:GetChildren()) do
		if Type == "Items" then
			
			for i=0, Thing.Value do
				
				if Thing.Value <= 0 then Thing:Destroy() return end
				
				local Template = script.ItemTemplate:Clone()
				Template.Parent = ListOfMoves
				Template.Item.Text = Thing.Name

				local PhysicalItem = Folder_Items:WaitForChild(Thing.Name)

				if PhysicalItem then
					local HealthValue = PhysicalItem:WaitForChild("Heal")
					local UsesValue = PhysicalItem:WaitForChild("Uses")

					Template.Uses.Text = UsesValue.Value
					Template.Stat.Text = HealthValue.Value
				end

				Template.Item.Activated:Connect(function()
					if not MoveChosen then
						MoveChosen = true

						TweenService:Create(ConfirmMove, IntroInfo, {Position = UDim2.new(0.3, 0,0.2, 0)}):Play()
						Moves.Blocker.Visible = true
						TweenService:Create(Moves.Blocker, FastIntroInfo, {TextTransparency = 0.2}):Play()

						task.spawn(function()
							task.spawn(function()
								ThinkIdle:Stop()
								Humanoid.Jump = true
							end)
						end)

						ConfirmMove.Confirm.Activated:Connect(function()
							MoveChosen = true
							TweenService:Create(Moves, ActionInfo, {Position = UDim2.new(-1, 0,0.6, 0)}):Play()
							TweenService:Create(ConfirmMove, IntroInfo, {Position = UDim2.new(-1, 0,0.2, 0)}):Play()

							Folder_Remotes.CastMove:FireServer("Item", Thing.Name)

							local Arena = CurrentArena:FindFirstChildOfClass("Folder")
							local ArenaCAM = Arena:WaitForChild("A_Cam")
							local PlayerCAM = Arena:WaitForChild("P_Cam")
							local EnemyCAM = Arena:WaitForChild("E_Cam")

							task.spawn(function()
								local T1 = TweenService:Create(Camera, ActionInfo, {CFrame = ArenaCAM.CFrame})
								local T2 = TweenService:Create(Camera, ActionInfo, {CFrame = EnemyCAM.CFrame})
								local T3 = TweenService:Create(Camera, ActionInfo, {CFrame = PlayerCAM.CFrame})

								T1:Play()
								T1.Completed:Wait()
								T2:Play()
								T2.Completed:Wait()
							end)
						end)

						ConfirmMove.Cancel.Activated:Connect(function()
							MoveChosen = false
							Moves.Blocker.Visible = false
							TweenService:Create(Moves.Blocker, FastIntroInfo, {TextTransparency = 1}):Play()
							TweenService:Create(ConfirmMove, IntroInfo, {Position = UDim2.new(-1, 0,0.2, 0)}):Play()
						end)
					end
				end)
			end
			
		elseif Type == "Weapons" then
			
			for i=0, Thing.Value do
				
				if Thing.Value <= 0 then Thing:Destroy() return end
									
				local Template = script.WeaponTemplate:Clone()
				Template.Parent = ListOfMoves
				Template.Item.Text = Thing.Name

				local PhysicalWeapon = Folder_Weapons:WaitForChild(Thing.Name)

				if PhysicalWeapon then
					local DamageValue = PhysicalWeapon:WaitForChild("Damage")
					local DurabilityValue = PhysicalWeapon:WaitForChild("Durability")

					Template.Durability.Text = DurabilityValue.Value
					Template.Damage.Text = DamageValue.Value
				end

				Template.Item.Activated:Connect(function()
					if not MoveChosen then
						MoveChosen = true

						TweenService:Create(ConfirmMove, IntroInfo, {Position = UDim2.new(0.3, 0,0.2, 0)}):Play()
						Moves.Blocker.Visible = true
						TweenService:Create(Moves.Blocker, FastIntroInfo, {TextTransparency = 0.2}):Play()

						task.spawn(function()
							ActionIdle:Stop()
							Humanoid.Jump = true
						end)

						ConfirmMove.Confirm.Activated:Connect(function()
							MoveChosen = true
							TweenService:Create(Moves, ActionInfo, {Position = UDim2.new(-1, 0,0.6, 0)}):Play()
							TweenService:Create(ConfirmMove, IntroInfo, {Position = UDim2.new(-1, 0,0.2, 0)}):Play()

							Folder_Remotes.CastMove:FireServer("Attack", Thing.Name)

							local Arena = CurrentArena:FindFirstChildOfClass("Folder")
							local ArenaCAM = Arena:WaitForChild("A_Cam")
							local PlayerCAM = Arena:WaitForChild("P_Cam")
							local EnemyCAM = Arena:WaitForChild("E_Cam")

							task.spawn(function()
								local T1 = TweenService:Create(Camera, ActionInfo, {CFrame = ArenaCAM.CFrame})
								local T2 = TweenService:Create(Camera, ActionInfo, {CFrame = EnemyCAM.CFrame})
								local T3 = TweenService:Create(Camera, ActionInfo, {CFrame = PlayerCAM.CFrame})

								T1:Play()
								T1.Completed:Wait()
								T2:Play()
								T2.Completed:Wait()
							end)
						end)

						ConfirmMove.Cancel.Activated:Connect(function()
							Moves.Blocker.Visible = false
							MoveChosen = false
							TweenService:Create(Moves.Blocker, FastIntroInfo, {TextTransparency = 1}):Play()
							TweenService:Create(ConfirmMove, IntroInfo, {Position = UDim2.new(-1, 0,0.2, 0)}):Play()
						end)
					end
				end)
			end
		end
	end
end

local function StartIntro(IconImage, MusicName)
	Icon.Image = "rbxassetid://" .. IconImage
	local Music = SoundTrack:FindFirstChild(MusicName)
	ChosenMusic = MusicName

	script.WooshIn:Play()

	TweenService:Create(IntroFrame, LongIntroInfo, {BackgroundTransparency = 0}):Play()
	TweenService:Create(Icon, FastIntroInfo, {Size = UDim2.new(0.5, 0,0.7, 0), Rotation = -4, ImageTransparency = 0}):Play()
	TweenService:Create(Dark1, IntroInfo, {Position = UDim2.new(-0.1,0,0.5,0)}):Play()
	TweenService:Create(Dark2, IntroInfo, {Position = UDim2.new(1.1,0,0.5,0)}):Play()

	Music.Playing = true
	TweenService:Create(Music, TweenInfo.new(1), {Volume = 0.65}):Play()

	task.wait(1.75)
	script.WooshOut:Play()

	TweenService:Create(IntroFrame, FastIntroInfo, {BackgroundTransparency = 1}):Play()
	TweenService:Create(Icon, LongIntroInfo, {Size = UDim2.new(0, 0,0, 0), Rotation = 5, ImageTransparency = 1}):Play()
	TweenService:Create(Dark1, FastIntroInfo, {Position = UDim2.new(-2,0,0.5,0)}):Play()
	TweenService:Create(Dark2, FastIntroInfo, {Position = UDim2.new(2,0,0.5,0)}):Play()
end

local function CueActions()
	TweenService:Create(Moves, LongIntroInfo, {Position = UDim2.new(0.26, 0,0.6, 0)}):Play()
	Moves.Blocker.Visible = false
	MoveChosen = false
	ClearStuff()
end

Folder_Remotes.StartBattle.OnClientEvent:Connect(function(Image, Music, Stat, NPC_Name)
	StartIntro(Image, Music)
	Folder_Events.MovementConfig:Fire(false)

	local NPC_Stats = require(Stat)
	local NPC = Folder_Assets.Models.Characters:FindFirstChild(NPC_Name)

	local Arena = CurrentArena:FindFirstChildOfClass("Folder")
	local ArenaCAM = Arena:WaitForChild("A_Cam")
	local PlayerCAM = Arena:WaitForChild("P_Cam")
	local EnemyCAM = Arena:WaitForChild("E_Cam")

	Camera.CameraType = Enum.CameraType.Scriptable
	Camera.CFrame = ArenaCAM.CFrame

	task.wait(1)

	TweenService:Create(ActInfo, ActionInfo, {Position = UDim2.new(0.5,0,0.85, 0)}):Play()
	PlayerFrame.PName.Text = Player.DisplayName
	PlayerFrame.Level.Text = "LVL . " .. PlayerStats.LVL.Value

	PlayerHP.Value.Text = math.floor(Humanoid.Health) .. "/" .. Humanoid.MaxHealth
	PlayerHP.Current.Size = UDim2.new(Humanoid.Health / Humanoid.MaxHealth,0,1,0)

	--
	EnemyFrame.EName.Text = NPC_Stats.NPC_Name
	EnemyFrame.Level.Text = "LVL . " .. NPC_Stats.LVL

	EnemyHP.Value.Text = math.floor(NPC.Humanoid.Health) .. "/" .. NPC.Humanoid.MaxHealth
	EnemyHP.Current.Size = UDim2.new(NPC.Humanoid.Health / NPC.Humanoid.MaxHealth,0,1,0)

	local EnemyModel = Arena.Enemies:FindFirstChildOfClass("Model")
	local EnemyHum = EnemyModel.Humanoid

	local OldPlayerHP = Humanoid.Health
	local OldEnemyHP = EnemyHum.Health

	Humanoid.Changed:Connect(function()
		if Humanoid.Health < OldPlayerHP then
			PlayerHP.Value.Text = math.floor(Humanoid.Health) .. "/" .. Humanoid.MaxHealth
			TweenService:Create(PlayerHP.Current, HPInfo, {Size = UDim2.new(Humanoid.Health / Humanoid.MaxHealth,0,1,0)}):Play()
		end

		OldPlayerHP = Humanoid.Health
	end)

	EnemyHum.Changed:Connect(function()
		if EnemyHum.Health < OldEnemyHP then
			EnemyHP.Value.Text = math.floor(EnemyHum.Health) .. "/" .. EnemyHum.MaxHealth
			TweenService:Create(EnemyHP.Current, HPInfo, {Size = UDim2.new(EnemyHum.Health / EnemyHum.MaxHealth,0,1,0)}):Play()
		end

		OldEnemyHP = EnemyHum.Health
	end)

	TweenService:Create(Camera, ActionInfo, {CFrame = PlayerCAM.CFrame}):Play()

	DeclareTurn("Players")
	CueActions()
		
	ItemsBtn.Activated:Connect(function()
		WeaponHelp.Visible = false
		ItemHelp.Visible = true
		ActionIdle:Stop()
		ThinkIdle:Play()
		LoadStuff("Items")
		Moves.Effect.Effect.Image = "rbxassetid://6794153626"
	end)

	WeaponsBtn.Activated:Connect(function()
		WeaponHelp.Visible = true
		ItemHelp.Visible = false
		ThinkIdle:Stop()
		ActionIdle:Play()
		LoadStuff("Weapons")
		Moves.Effect.Effect.Image = "rbxassetid://6794259017"
	end)
end)

Folder_Remotes.MoveCompleted.OnClientEvent:Connect(function(Move, Team)
	if not CurrentArena:FindFirstChildOfClass("Folder") then return end

	local Arena = CurrentArena:FindFirstChildOfClass("Folder")

	local ArenaCAM = Arena:WaitForChild("A_Cam")
	local PlayerCAM = Arena:WaitForChild("P_Cam")
	local EnemyCAM = Arena:WaitForChild("E_Cam")

	local T1 = TweenService:Create(Camera, ActionInfo, {CFrame = ArenaCAM.CFrame})
	local T2 = TweenService:Create(Camera, ActionInfo, {CFrame = EnemyCAM.CFrame})
	local T3 = TweenService:Create(Camera, ActionInfo, {CFrame = PlayerCAM.CFrame})

	if Move == "Attack" and Team == "Players" then
		T1:Play()
		T1.Completed:Wait()
		T3:Play()
		T3.Completed:Wait()

	elseif Move == "Attack" and Team == "Enemies" then
		DeclareTurn("Players")
		ClearStuff()
		CueActions()

	elseif Move == "Item" and Team == "Players" then	
		T1:Play()
		T1.Completed:Wait()
		T3:Play()
		T3.Completed:Wait()
	end
end)

Folder_Remotes.EnemyTurn.OnClientEvent:Connect(function()
	DeclareTurn("Enemies")
	Folder_Remotes.EnemyMove:FireServer("Attack")
end)

Folder_Remotes.EndBattle.OnClientEvent:Connect(function()
	TransitionModule:TweenIn(1)

	local Music = SoundTrack:FindFirstChild(ChosenMusic)
	local MusicTween = TweenService:Create(Music, TweenInfo.new(1), {Volume = 0})
	Music.TimePosition = 0
	MusicTween:Play()
	MusicTween.Completed:Wait()
	Music.Playing = false
	Camera.CameraType = Enum.CameraType.Custom
	TweenService:Create(ActInfo, ActionInfo, {Position = UDim2.new(0.5,0,1.5, 0)}):Play()
	task.wait(3)
	TransitionModule:TweenOut(0.5)
end)

The Attempts I made was doing:

if Thing.Value <= 0 then Thing:Destroy() return end

wait i noticed something… hold on. i may try doing thing.uses.value

EDIT: Nevermind. I don’t think that was the case.

4 Likes

Where did you put the line? If it isn’t in some kind of loop function, it may not work.

2 Likes

You also might be destroying the item in a local script.

1 Like

The line was done in a for loop here:

		if Type == "Items" then
			
			for i=-1, Thing.Value do
				
				local Template = script.ItemTemplate:Clone()
				Template.Parent = ListOfMoves
				Template.Item.Text = Thing.Name

				local PhysicalItem = Folder_Items:WaitForChild(Thing.Name)

				if PhysicalItem then
					local HealthValue = PhysicalItem:WaitForChild("Heal")
					local UsesValue = PhysicalItem:WaitForChild("Uses")

					Template.Uses.Text = UsesValue.Value
					Template.Stat.Text = HealthValue.Value
				end
--... more lines past here
3 Likes

I don’t see the destroy function…

2 Likes

I removed it since I realised a better thing to do was to -1 from the value.

The value works as like: “How many of this item the player has.”

Here’s the full function.

		if Type == "Items" then
			
			for i=1, Thing.Value do
				
				local Template = script.ItemTemplate:Clone()
				Template.Parent = ListOfMoves
				Template.Item.Text = Thing.Name

				local PhysicalItem = Folder_Items:WaitForChild(Thing.Name)

				if PhysicalItem then
					local HealthValue = PhysicalItem:WaitForChild("Heal")
					local UsesValue = PhysicalItem:WaitForChild("Uses")

					Template.Uses.Text = UsesValue.Value
					Template.Stat.Text = HealthValue.Value
				end

				Template.Item.Activated:Connect(function()
					if not MoveChosen then
						MoveChosen = true

						TweenService:Create(ConfirmMove, IntroInfo, {Position = UDim2.new(0.3, 0,0.2, 0)}):Play()
						Moves.Blocker.Visible = true
						TweenService:Create(Moves.Blocker, FastIntroInfo, {TextTransparency = 0.2}):Play()

						task.spawn(function()
							task.spawn(function()
								ThinkIdle:Stop()
								Humanoid.Jump = true
							end)
						end)

						ConfirmMove.Confirm.Activated:Connect(function()
							MoveChosen = true
							TweenService:Create(Moves, ActionInfo, {Position = UDim2.new(-1, 0,0.6, 0)}):Play()
							TweenService:Create(ConfirmMove, IntroInfo, {Position = UDim2.new(-1, 0,0.2, 0)}):Play()

							Folder_Remotes.CastMove:FireServer("Item", Thing.Name)
							Thing.Value -= 1

							local Arena = CurrentArena:FindFirstChildOfClass("Folder")
							local ArenaCAM = Arena:WaitForChild("A_Cam")
							local PlayerCAM = Arena:WaitForChild("P_Cam")
							local EnemyCAM = Arena:WaitForChild("E_Cam")

							task.spawn(function()
								local T1 = TweenService:Create(Camera, ActionInfo, {CFrame = ArenaCAM.CFrame})
								local T2 = TweenService:Create(Camera, ActionInfo, {CFrame = EnemyCAM.CFrame})
								local T3 = TweenService:Create(Camera, ActionInfo, {CFrame = PlayerCAM.CFrame})

								T1:Play()
								T1.Completed:Wait()
								T2:Play()
								T2.Completed:Wait()
							end)
						end)

						ConfirmMove.Cancel.Activated:Connect(function()
							MoveChosen = false
							Moves.Blocker.Visible = false
							TweenService:Create(Moves.Blocker, FastIntroInfo, {TextTransparency = 1}):Play()
							TweenService:Create(ConfirmMove, IntroInfo, {Position = UDim2.new(-1, 0,0.2, 0)}):Play()
						end)
					end
				end)
			end

I’m slowly getting to a answer and my idea was to do a loop on the server to detect items with a value equal to or below 0 and to delete them.

1 Like

Have you checked if the value changes?

Send me the function of where the destroy function is.

1 Like

The value seems to change weirdly and I have done a weird method. I’ve for some reason started checking the values on the physical templates and just taking away their values. I think what I was trying to do was to do that for the player. I think the best solution is instead of doing 0.9. I could do 10 and have like 10 uses and take those away instead.

image

Here’s the destroy function on the server:

one sec, sending it

Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		local Bool = Instance.new("BoolValue", Player)
		Bool.Name = "InBattle"

		local Obj1 = Instance.new("ObjectValue", Player)
		Obj1.Name = "Battling"

		local InventoryFolder = Instance.new("Folder", Player)
		InventoryFolder.Name = "PlayerInventory_" .. tostring(Player.UserId)

		local ItemFolder = Instance.new("Folder", InventoryFolder)
		ItemFolder.Name = "PlayerItems"

		local WeaponFolder = Instance.new("Folder", InventoryFolder)
		WeaponFolder.Name = "PlayerWeapons"

		local PlayerData = Player:WaitForChild("PlayerStatistics")
		local PlayerItems = PlayerData:WaitForChild("Items")
		local PlayerWeapons = PlayerData:WaitForChild("Items")


		for _, Item in pairs(PlayerItems:GetChildren()) do
			if Item:IsA("NumberValue") then
				local AmountOfItems = Item.Value

				for i=0, AmountOfItems do
					local ItemToClone = Folder_Items:FindFirstChild(Item.Name):Clone()
					ItemToClone.Parent = ItemFolder

					ItemToClone.Name = ItemToClone.Name
					task.wait(0.01)
					i+=1
				end
			end
		end
		
		
		task.spawn(function()
			while true do
				for _, Item in pairs(ItemFolder:GetChildren()) do
					if Item:IsA("IntValue") then
						if Item.Value <= 0 then
							Item:Destroy()
						end
					end
				end

				for _, Weapon in pairs(WeaponFolder:GetChildren()) do
					if Weapon:IsA("IntValue") then
						if Weapon.Value <= 0 then
							Weapon:Destroy()
						end
					end
				end
				task.wait(1)
			end
		end)
	end)
end)

(yes im aware my code is messy and probably bad)

1 Like

What you’re trying to destroy is only the values and not the items itself. I suppose that might be the answer?

1 Like

The way that I have done it is quite poorly honestly. I get the stats and the information of the mallet off of the folder. The values tell me if I have any of those items.

The way I was trying to get it to work is:

If Mallet has a value of 1 or above
get information and attack
remove mallet use by one or lower its durability

image

I understand how you’ve done it. But your for loop checks if the instance is an “IntValue” and not a tool or an item or whatever. Basically what I mean is that your script destroys the IntValue and not the weapon.

Hmmmm… How would I be able to well do this. I’m now a bit puzzled…

1 Like

Run the game and send me a screenshot of the folders and the values that are inside the player. That might help.

image

1 Like

i may have needed to check if the folder exists due to duplicates and I think that was what I was meant to be taking off instead.

Open up all of the folders and I could help

Have you found the solution and made it work?