Gui Tween Not Working?

Im making a gui tween and the function works fine but the tween wont work, could anybody help me out?

–Here’s The Script

local GoalPosition = “0.265, 0,0.096, 0”
local OriginPosition = “0, 786,0, 631”

local TweenService = game:GetService(“TweenService”)
local Troll = game:GetService(“StarterGui”).Troll.ImageLabel

game.Players.LocalPlayer.Character:FindFirstChildWhichIsA(“Humanoid”).Died:Connect(function ()
print(“Check”)

local goal1 = {}
goal1.Position = UDim2.new(tonumber(GoalPosition))

local TweenInfo1 = TweenInfo.new(0.45)

local Tween1 = TweenService:Create(Troll, TweenInfo1, goal1)
Tween1:Play()
end)

Its Also In A Local Script

You’re tweening objects in the StarterGui when you should be tweening the PlayerGui’s objects.

Code:

local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")

local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Troll = LocalPlayer:WaitForChild("PlayerGui").Troll.ImageLabel

local GoalPosition = UDim2.fromScale(0.265, 0.096)
local OriginPosition = Troll.Position

Humanoid.Died:Connect(function()
	print("Check")

	local Tween1 = TweenService:Create(Troll, TweenInfo.new(0.45), {Position = GoalPosition})
	Tween1:Play()
end)

Thanks for helping me out , ive been stuck on this for awhile.

1 Like

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