Im trying to make my value +1

i trying to make my value +1

		if findquest then
			findquest.Value =+1
		end

local findquest = player.Backpack.Quest:FindFirstChild(“UseArrow”)

1 Like

its += not =+

if findquest then
			findquest.Value += 1
end
local findquest = player.Backpack.Quest:FindFirstChild(“UseArrow”)
3 Likes

the value isint going up idk why

local findQuest = player.Backpack.Quest:FindFirstChild("UseArrow")
if findQuest then
    findQuest.Value += 1
end

Are you just running the script once or multiple times?
Try giving us your entire script.

im doing a quest system like my quest is doing something and if tool activated if player.Backpack findfirstchild the value , value+1

Hey! Thanks for that information :wink:. Erm… unfortunately, that doesn’t help us resolve this issue. If you have code samples to provide so we can further assist you, that would be appreciated.

If your code isn’t working properly, it’d also be nice if you could provide us with the errors that the Output is giving you. The Output is a window in studio that let’s you get a better insight as to what’s going on.

the output dont have any error but the value is not going up

It may be that ‘findquest’ is not found. Try this:

local findQuest = player.Backpack.Quest:WaitForChild("UseArrow")
if findQuest then
    findQuest.Value += 1
end

if findquest then
findquest.Value = findquest.Value + 1
end


try that

findquest does not exist, or is the wrong ValueBase type. You should always debug your code before you post here.

Do
findQuest.Value = findQuest.Value + 1

Are you sure UseArrow is an IntValue?

  1. Are you sure the value is not going up? It could be that you are changing the value through a localscript and you are checking if the value increased in the server.

  2. Are you sure UseArrow exists on your location? Try to add this line before the local findQuest line. (This code will repeat until UseArrow exists since the script could have loaded before the UseArrow exists.)

repeat wait() until player.Backpack.Quest:FindFirstChild("UseArrow")

try

if findquest then
   findquest.Value = findquest.Value + 1
end
1 Like

Please please please please post your entire script.
We’ve asked twice, but you reply with a vague answer about what’s happening.

From me:
“Try giving us your entire script.”

From @NoParameters
“If you have code samples to provide so we can further assist you, that would be appreciated.”

2 Likes

You could try this? I haven’t tested this so let me know what you got.

if findquest then
			findquest.Value = findquest.Value + 1
		end

print(findquest)

I’m guessing it’s nil.

then try

print(player.Backpack.Quest:FindFirstChild(“UseArrow”))

I’m guessing it is nil as well. Go into the player’s backpack while the game is playing and make sure UseArrow is there.

ok this is my use arrow script i made it if player.Backpack find UseArrow value then the value +1

local Tool = script.Parent

local rp = game:GetService(“ReplicatedStorage”)
local Arrow = rp:WaitForChild(“GetStand”)
local ServerStorage = game:GetService(“ServerStorage”)
local player = game.Players.LocalPlayer
local character = player.CharacterAdded:Wait()
local humanoid = character:WaitForChild(“Humanoid”)
local debounce = false

local aura1 = script.Bolts:Clone()
local aura2 = script.Bubble:Clone()

local canuse = player.Backpack.Value.CanArrow

Tool.Activated:Connect(function()
if canuse.Value == true then
if debounce == false then
debounce = true
local anim = script.Use:Clone()
humanoid:LoadAnimation(anim):Play()
humanoid.WalkSpeed = 0
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
local stabsound = script[“Stab Sound”]:Clone()
stabsound.Parent = character.Head
stabsound:Play()
Tool.Unequipped:Connect(function()
wait(0.000000001)
humanoid:EquipTool(Tool)
end)
aura2.Parent = character.UpperTorso
aura1.Parent = character.UpperTorso

		local findQuest = player.Backpack:FindFirstChild("UseArrow")

		if findquest then
			findquest.Value = findquest.Value + 1
		end

		wait(3.35)

		wait(1.7)

		Arrow:FireServer()

		Tool:Destroy()

		humanoid.WalkSpeed = 16
		humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
		aura1:Destroy()
		aura2:Destroy()
		debounce = false
	end
end	

end)

and this is my quest script i made it if u dont have the value it give u the value

local button = script.Parent

button.MouseButton1Click:Connect(function()

local player = game.Players.LocalPlayer
local char = player.Character
local hum = char.Humanoid
local bag = player.Backpack

if bag:FindFirstChild("UseArrow") then
	button.Parent.Visible = false
	button.Parent.Parent.CheckQuest.Visible = true
	button.Parent.Visible = false
else
	local value = Instance.new("NumberValue")
	value.Name = "UseArrow"
	value.Parent = bag

	hum.WalkSpeed = 16
	hum:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
	local player = game.Players.LocalPlayer
	
	local cc = game.Workspace.CurrentCamera

	cc.CameraType = Enum.CameraType.Custom

end

end)

Did you solve this? You have 2 different capitalizations here. I’d start with that.

1 Like