Hello, I was wondering if you guys could help me with something, im trying to make a gui that pops up when you join but it doesn't work
local frame = script.Parent local Players = game:GetService("Players") Players.PlayerAdded:connect(function() frame:TweenPosition(UDim2.new(0, 10, 0, 10)) end)
For first, PlayerAdded
not work in LocalScript. you need to use CharacterAdded
.
Remember. :connect is deprecated use :Connect
Wiki pages:
You can try this:
-- LOCAL SCRIPT -- local frame = script.Parent local Player = game:GetService("Players").LocalPlayer Player.CharacterAdded:Connect(function() if frame.Position ~= UDim2.new(0, 10, 0, 10) then frame:TweenPosition(UDim2.new(0, 10, 0, 10)) end end)
Hope it helped! :)