This is the first time I’ve encountered this problem, my tween script is not working which is this:
script.Parent.MouseButton1Click:Connect(function()
local plrscroller = game.StarterGui.MainUI.PlayerScroller
plrscroller:TweenPosition(UDim2.new(0.755, 0,0.25, 0), "Out", "Back")
end)
a usual script now this is the location:
You can see that the textbutton has the local script and when i try it in game it doesnt work, also the position im trying to change is scrollingframe.
There is no StarterGui, change StarterGui to PlayerGui, in the running game the Assets in StarterGui will copied to the PlayerGui.
local playerGui = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
local plrscroller = playerGui:WaitForChild("MainUI"):WaitForChild("PlayerScroller")
script.Parent.MouseButton1Click:Connect(function()
plrscroller:TweenPosition(UDim2.new(0.755, 0,0.25, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 1, true, nil)
end)
Change to game.Players.LocalPlayer.PlayerGui.MainUI.PlayerScroller
instead. StarterGui does not contain the player’s UI.
Fimutsuu
(Fimutsu)
May 5, 2023, 1:33pm
#5
As the other guys said above change it to LocalPlayer.PlayerGui
what you’re doing now is referencing StarterGui which contains the gui for the server not for the player
I did not really think of that, thank you everyone who had helped!
system
(system)
Closed
May 19, 2023, 1:34pm
#7
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.