For some reason the text in the bill board gui doesnt want to tween can someone help!?!
local tweenService = game:GetChildren("TweenService")
local debounce = false
local billboardGui = script.Parent.Parent.WinnersEffect.NameEffect
local nameEffectText = billboardGui.NameEffectText
script.Parent.Touched:Connect(function(hit)
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if player then
if hit.Parent.Humanoid.Health == 100 then
local character = hit.Parent
if character then
if debounce == false then
debounce = true
billboardGui.StudsOffset = Vector3.new(0,4,0)
local playerName = hit.Parent.Name
billboardGui.NameEffectText.Text = playerName.." Won!🎈"
local info = TweenInfo.new(
3,
Enum.EasingStyle.Bounce,
Enum.EasingDirection.Out,
0,
false,
0
)
local goals =
{
Size = UDim2.new(0,400,0,100)
}
local PlayerEffectTween = tweenService:Create(nameEffectText, info, goals)
PlayerEffectTween:Play()
for i,v in pairs(script.Parent.Parent.WinnersEffect.Attachment:GetChildren()) do
v.Enabled = true
end
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if humanoidRootPart then
humanoidRootPart.CFrame = game.Workspace.GameFolder.LobbyPart.CFrame
end
end
end
player.leaderstats.Wins.Value += 1
end
end
debounce = false
wait(1)
for i,v in pairs(script.Parent.Parent.WinnersEffect.Attachment:GetChildren()) do
v.Enabled = false
end
end)
Hello, I think I know how to fix your problem. There are a few issues with your code that could be causing the problem:
tweenService is not being correctly fetched. game:GetChildren("TweenService") will return a table, not the service itself. Instead, you should use game:GetService("TweenService") to properly fetch the TweenService.
You are creating the Tween with nameEffectText as the target. However, nameEffectText is a TextLabel and UDim2 is applicable to GuiObjects, so you’re trying to tween a property of the GuiObject, not the TextLabel. Change the target to billboardGui to fix this.
The TweenInfo object has its RepeatCount set to 0. This means that the tween will not repeat. If you want the tween to repeat you should set this value to -1 (for infinite repeating) or to any other positive number to specify the amount of times you want it to repeat.
Here’s your revised code:
local tweenService = game:GetService("TweenService")
local debounce = false
local billboardGui = script.Parent.Parent.WinnersEffect.NameEffect
local nameEffectText = billboardGui.NameEffectText
script.Parent.Touched:Connect(function(hit)
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if player then
if hit.Parent.Humanoid.Health == 100 then
local character = hit.Parent
if character then
if debounce == false then
debounce = true
billboardGui.StudsOffset = Vector3.new(0,4,0)
local playerName = hit.Parent.Name
nameEffectText.Text = playerName.." Won!🎈"
local info = TweenInfo.new(
3,
Enum.EasingStyle.Bounce,
Enum.EasingDirection.Out,
0,
false,
0
)
local goals =
{
Size = UDim2.new(0,400,0,100)
}
local PlayerEffectTween = tweenService:Create(billboardGui, info, goals)
PlayerEffectTween:Play()
for i,v in pairs(script.Parent.Parent.WinnersEffect.Attachment:GetChildren()) do
v.Enabled = true
end
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if humanoidRootPart then
humanoidRootPart.CFrame = game.Workspace.GameFolder.LobbyPart.CFrame
end
end
end
player.leaderstats.Wins.Value += 1
end
end
debounce = false
wait(1)
for i,v in pairs(script.Parent.Parent.WinnersEffect.Attachment:GetChildren()) do
v.Enabled = false
end
end)
Make sure your billboardGui has the property ‘Size’ that can be manipulated. The reason is that ‘Size’ is the property that you’re trying to tween. If ‘Size’ doesn’t exist, the tween will fail. Hope It helps!