Cannot add values

How would I implement that in code?

Nothing to implement, just check the value in the place i told you

Iā€™ve checked it, same thing. I honestly donā€™t know what Iā€™m doing wrong :sob:

If anyone could see what I did wrong, please call me out on it. I am really stuck on this :sob:

local TweenService = game:GetService("TweenService")
local Camera = workspace.CurrentCamera
local tweenInf = TweenInfo.new(1, Enum.EasingStyle.Circular, Enum.EasingDirection.Out, 0, false, 0)
local tweenInfText = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0)

local NPC = game.Workspace.NPCGroup.NPC
local MainCam = game.Workspace.NPCGroup.Camera
local Player = game.Players.LocalPlayer
local Character = Player.Character

local Dialog = script.Parent.DialogueHolder
local Choices = script.Parent.ChoicesHolder
local DialogText = Dialog.Dialogue
local NPCName = Dialog.NPCName

local function typeMessage(txt, typeTime)
	for i=1, #txt do
		DialogText.Text = string.sub(txt, 1, i)
		wait(typeTime / #txt)
	end
end

local RepSto = game.ReplicatedStorage
local Trigger = RepSto.DialogChoiceTrigger
local CorrectChoice = Player.PlayerGui.ChoicesGui.CorrectChoice
local ChoiceValue = Player.PlayerGui.ChoicesGui.ChoicesValue

function Tween(Camera, cameranew)
	local info = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0)
	Camera.CameraType = Enum.CameraType.Scriptable
	local tween = TweenService:Create(Camera, tweenInf, {CFrame = cameranew.CFrame})
	tween:Play()
end

Trigger.OnClientEvent:Connect(function()
	Tween(game.Workspace.CurrentCamera, MainCam)
	NPCName.Text = NPC.Name
	typeMessage("Test", 1)
	wait(1)
	ChoiceValue.Value += 1
	Choices:TweenPosition(UDim2.new(0.56, 0, 0.399, 0))
	typeMessage("...", 0.25)
end)

More info about this:
Screenshot (172)
This is the layout of the ChoiceGui

Try this, to see if it works:

ChoiceValue.Value = (ChoiceValue.Value + 1)

Else, send the console.

You can simply do

ChoiceValue.Value += 1

instead of that

Doesnā€™t work, still the same thing

Hereā€™s the console:

Did the same thing as well, didnā€™t work :face_exhaling:

Can you add a print statement to check if the client event has fired?

Mhm. Sandwiched two prints with the ChoiceValue in the mid. Both of them printed, but the value itself didnā€™t change

Would you want to send a place download so I can see what is going on in the game?

experiment.rbxl (469.9 KB)

dont mind the place, its quite messy hehe.

image
The value seems to be adding just fine

image
I do not see anything wrong with the code

When you activate it via Proximity Prompt?

image
Yup, the value gets increased after interacting with the prompt.

Can I see a video of the code working? Somehow it doesnā€™t work for me :confused:

Where were you checking the ChoicesValue? StarterGui?

PlayerGui, a developer in this thread told me about it and I changed the code.

image
I stored the before and after value and printed it out. The value does indeed increase after interacting with the prompt