script.Parent.Value:GetPropertyChangedSignal("Value"):Connect(function() script.Parent.Text = script.Parent.Value.Value end)
error: text still isnt changing?
this is the script inside the text label that will change the text based on the IntValue's Value, but the text is not changing from 0 to 9292, because the IntValue is 9292 but text is not. How do I connect these two variables?
btw this is the script that changes the value, which is perfectly fine.
local ts = game:GetService("TweenService") local player = game.Players.LocalPlayer local p1 = script.Parent.Parent.rollmove.RI local p2 = script.Parent.Parent.rollmove.RII local box = script.Parent.Parent.rollmove.Box local click = script.Parent.ClickDetector local dicee = script.Parent.Parent.rollmove.dice:GetChildren() local dice = script.Parent.Parent.rollmove.dice local dicenum = #dicee for i = 1,dicenum do local diceget = dicee[i] diceget.Anchored = true end local function roll() script.Parent.SurfaceGui.Rolling.Visible = true script.Parent.SurfaceGui.Roll.Visible = false player:WaitForChild("PlayerGui").ScoreCard.Background.line1.Rolls.I.Value.Value = player:WaitForChild("PlayerGui").ScoreCard.Background.line1.Rolls.I.Value.Value + 1 player:WaitForChild("PlayerGui").ScoreCard.Background.line1.Rolls.II.Value.Value = player:WaitForChild("PlayerGui").ScoreCard.Background.line1.Rolls.II.Value.Value + 1 player:WaitForChild("PlayerGui").ScoreCard.Background.line1.Rolls.III.Value.Value = player:WaitForChild("PlayerGui").ScoreCard.Background.line1.Rolls.III.Value.Value + 1 player:WaitForChild("PlayerGui").ScoreCard.Background.line1.Rolls.IV.Value.Value = player:WaitForChild("PlayerGui").ScoreCard.Background.line1.Rolls.IV.Value.Value + 1 player:WaitForChild("PlayerGui").ScoreCard.Background.line1.Rolls.V.Value.Value = player:WaitForChild("PlayerGui").ScoreCard.Background.line1.Rolls.V.Value.Value + 1 wait() local function moveItem(item, wp) local ti = TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0) local tween = ts:Create(item, ti, { Position = wp.Position}) tween:Play() wait(2) end local function moveItems(item, wp) local ti = TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0) local tween = ts:Create(item, ti, { Position = wp.Position}) tween:Play() wait(0.1) end for i = 1,dicenum do local diceget = dicee[i] moveItems(diceget, p1) end moveItem(box, p1) for i = 1,dicenum do local diceget = dicee[i] diceget.Transparency = 1 moveItems(diceget, p2) end moveItem(box, p2) box.Orientation = Vector3.new(0,180,180) for i = 1,dicenum do local diceget = dicee[i] diceget.Transparency = 0 diceget.Anchored = false end wait(2) for i = 1,dicenum do local diceget = dicee[i] diceget.Anchored = true diceget.Transparency = 1 moveItems(diceget, p1) end moveItem(box,p1) box.Orientation = Vector3.new(0,0,0) script.Parent.SurfaceGui.Rolling.Visible = false script.Parent.SurfaceGui.Roll.Visible = true end click.MouseClick:Connect(roll)
The problem is that you're using a local script inside of a server script which will result in an error. Instead, use a server script.
Add a remote in replicatedstorage
Server Script
local ts = game:GetService("TweenService") local p1 = script.Parent.Parent.rollmove.RI local p2 = script.Parent.Parent.rollmove.RII local box = script.Parent.Parent.rollmove.Box local click = script.Parent.ClickDetector local dicee = script.Parent.Parent.rollmove.dice:GetChildren() local dice = script.Parent.Parent.rollmove.dice local dicenum = #dicee for i = 1,dicenum do local diceget = dicee[i] diceget.Anchored = true end script.Parent.ClickDetector.MouseClick:Connect(function(player) script.Parent.SurfaceGui.Rolling.Visible = true script.Parent.SurfaceGui.Roll.Visible = false wait() local function moveItem(item, wp) local ti = TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0) local tween = ts:Create(item, ti, { Position = wp.Position}) tween:Play() wait(2) end local function moveItems(item, wp) local ti = TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0) local tween = ts:Create(item, ti, { Position = wp.Position}) tween:Play() wait(0.1) end for i = 1,dicenum do local diceget = dicee[i] moveItems(diceget, p1) end moveItem(box, p1) for i = 1,dicenum do local diceget = dicee[i] diceget.Transparency = 1 moveItems(diceget, p2) end moveItem(box, p2) box.Orientation = Vector3.new(0,180,180) for i = 1,dicenum do local diceget = dicee[i] diceget.Transparency = 0 diceget.Anchored = false end wait(2) for i = 1,dicenum do local diceget = dicee[i] diceget.Anchored = true diceget.Transparency = 1 moveItems(diceget, p1) end moveItem(box,p1) box.Orientation = Vector3.new(0,0,0) script.Parent.SurfaceGui.Rolling.Visible = false script.Parent.SurfaceGui.Roll.Visible = true end)
Client
local ReplicatedStorage = game:GetService("ReplicatedStorage") local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent") local player = game.Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") player:WaitForChild("PlayerGui").ScoreCard.Background.line1.Rolls.I.Value.Value = player:WaitForChild("PlayerGui").ScoreCard.Background.line1.Rolls.I.Value.Value + 1 player:WaitForChild("PlayerGui").ScoreCard.Background.line1.Rolls.II.Value.Value = player:WaitForChild("PlayerGui").ScoreCard.Background.line1.Rolls.II.Value.Value + 1 player:WaitForChild("PlayerGui").ScoreCard.Background.line1.Rolls.III.Value.Value = player:WaitForChild("PlayerGui").ScoreCard.Background.line1.Rolls.III.Value.Value + 1 player:WaitForChild("PlayerGui").ScoreCard.Background.line1.Rolls.IV.Value.Value = player:WaitForChild("PlayerGui").ScoreCard.Background.line1.Rolls.IV.Value.Value + 1 player:WaitForChild("PlayerGui").ScoreCard.Background.line1.Rolls.V.Value.Value = player:WaitForChild("PlayerGui").ScoreCard.Background.line1.Rolls.V.Value.Value + 1 RemoteEvent:FireServer()
If it doesn't work, let me know so I can fix it.
script.Parent.Value:Changed:Connect(function() script.Parent.Text = script.Parent.Value.Value end)
This should work