Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

why is this gui not popping up upon event?

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)

1 answer

✓ Accepted answer

For first, PlayerAdded not work in LocalScript. you need to use CharacterAdded.

Remember. :connect is deprecated use :Connect

Wiki pages:

Player Added

Character Added

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! :)

1 comment

0

Thx! :D

This discussion is preserved as it was. New answers, comments, and votes are closed.