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
If anyone could see what I did wrong, please call me out on it. I am really stuck on this
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:
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
Did the same thing as well, didnāt work
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?
The value seems to be adding just fine
I do not see anything wrong with the code
When you activate it via Proximity Prompt?
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
Where were you checking the ChoicesValue? StarterGui?
PlayerGui, a developer in this thread told me about it and I changed the code.
I stored the before and after value and printed it out. The value does indeed increase after interacting with the prompt