Round Changing Function Not Working, Help!?

This script is a local script inside of a ScreenGui
I’ve had no errors from this script
but it seems to not work anyways
I’ve used – towards comments which should help you



local Players = game:GetService("Players")
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local hover = game.Players.LocalPlayer.PlayerGui:WaitForChild("Hover")
local click = game.Players.LocalPlayer.PlayerGui:WaitForChild("Click")
local music = game.Players.LocalPlayer.PlayerGui:WaitForChild("Music")

local roundChanged = game.Players.LocalPlayer.PlayerGui:WaitForChild("RoundChange") -- round change music

local changingEvent = game.ReplicatedStorage.Bindable:WaitForChild("RoundChange") -- A Bindable Event in ServerStorage

local roundNumber = ReplicatedStorage:WaitForChild("RoundNumber") -- I have an int value in ServerStorage

local roundFrame = script.Parent:WaitForChild("RoundChangeFrame") --  the round frame

--changeRound function
local function changeRound()
	roundFrame.TextLabel.Text = roundNumber.Value
	wait(1)
	roundChanged:Play()
	wait(8.9)
	roundFrame.TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
	for i = 1,10 do
		roundFrame.TextLabel.TextTransparency += 0.1
		wait(.1)
	end
	wait(.1)
	roundFrame.TextLabel.TextColor3 = Color3.fromRGB(255, 0, 4)

	for i = 1,10 do
		roundFrame.TextLabel.TextTransparency -= 0.1
		wait(.1)
	end
	wait(.1)
	roundFrame.TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)

	for i = 1,10 do
		roundFrame.TextLabel.TextTransparency += 0.1
		wait(.1)
	end
	wait(.1)
	roundFrame.TextLabel.TextColor3 = Color3.fromRGB(255, 0, 4)

	for i = 1,10 do
		roundFrame.TextLabel.TextTransparency -= 0.1
		wait(.1)
	end
	wait(.1)
	roundFrame.TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)

	for i = 1,10 do
		roundFrame.TextLabel.TextTransparency += 0.1
		wait(1)
		roundFrame.TextLabel.TextTransparency = 0
		roundFrame.TextLabel.TextColor3 = Color3.fromRGB(255, 0, 4)
		roundFrame.TextLabel.Text = roundNumber.Value + 1
		wait(4)
		roundChange:Stop()
		return
	end

--when I try to test this script by making a button activating a bindableEvent as seen here >>

bindableEvent.Event:Connect(function()

script.Parent.Enabled = true
	controls:Disable()
	music:Play()
		tween:Play()
		changeRound()
end)

There isn’t much information to help here, Please:

  • Provide where any errors are

  • Comment on what certain code does

You should also preformat you code:

 -- Should look like this
 -- code here
1 -- number
"String" -- string

This is a Horrible way of doing it, Use TweenService

local TweenService = game.TweenService

Info = TweenInfo.new(
   1, -- Duration
   Enum.EasingStyle.Linear, -- Transition
   Enum.EasingDirection.InOut, -- Transition Type
   4, -- Times Repeated
   true, -- Reversed?
   0, -- Delay?
)

local T = TweenService:Create(roundFrame.TextLabel, Info, {TextTransparency = 1})
T:Play()


Why are you doing this on the Client? Handle it on the Server

1 Like

This works really well, thank you so much!!!

local Info = TweenInfo.new(0.1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,4,true,0)
local function roundChange()
roundFrame.TextLabel.Text = roundNumber.Value
local T = TweenService:Create(roundFrame.TextLabel, Info, {TextTransparency = 1})
roundChanged:Play()
wait(8.9)
T:Play()
T.Completed:Wait(1)
roundNumber.Value += 1
wait(1)
roundFrame.TextLabel.Text = roundNumber.Value
end

changingEvent.Event:Connect(function()

roundChange()
print("RoundChanged")
end)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.