Open gui if value diffrent

i want to achieve like if u have value 1 the gui open and if u have value 2 the other gui open

1 Like

local value = 1
If value == 1 then
[insert code]
elseif value == 2 then
[insert code]
end

Edit:
Make a way to change the values somehow.

1 Like

You simply need an “if” statement like this

if Value == 1 then
Frame1.Visible = true
elseif Value == 2 then
Frame2.Visible = true
else
Frame1.Visible = false
Frame2.Visible = false
end

I wrote this on phone Sorry

2 Likes

how to change it like numbervalue

How to change the value to open it?

no i using a numbervalue in playerbackpack

Value need to be that numbervalue

1 Like

Can you explain in detail what you are trying to achieve? What kind of GUI is it, is it screen gui?

1 Like

this is my script

game.Workspace.Map.Quest.ClickDetector.MouseClick:Connect(function(player)
if player:FindFirstChild(“UseArrow”) then
local cc = game.Workspace.CurrentCamera

	cc.CameraType = Enum.CameraType.Scriptable

	cc.CFrame = game.Workspace.Quest1Cam.CFrame
	player:WaitForChild("PlayerGui").Quest.Quest1.CheckQuest.Visible = true
	
	humanoid.WalkSpeed = 0
	humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
else
	local cc = game.Workspace.CurrentCamera

	cc.CameraType = Enum.CameraType.Scriptable

	cc.CFrame = game.Workspace.Quest1Cam.CFrame
	
	local char = player.Character

	local humanoid = char:WaitForChild("Humanoid")

	humanoid.WalkSpeed = 0
	humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
		
	player:WaitForChild("PlayerGui").Quest.Quest1.GetQuest.Visible = true
end

end)

1 Like

Simply do game:GetService(“Players”).LocalPlayer.Backpack.NumberValue.Value

1 Like

like that my script if player.backpack findfirstchild UseArrow the other gui open when you talk to the npc

Can you tell me what you are trying to do?

1 Like

Yes, what are you trying to do?

1 Like

i m trying to make a quest system , and after the npc give u the numbervalue name “UseArrow” and then if u talk to the npc again the gui will change and ask you did u finish the quest

You can change texts and not add another entire ui

Simply save a variable with numbers to know in what page the player is

Sorry if I can’t do the script myself I am in my phone