Argument 3 missing or nil

  1. What do you want to achieve? I am making a notification system that notify you when someone joins the games, I am also trying to animate it using TweenService.

  2. What is the issue? I keep getting “Argument 3 missing or nil” at line 14

  3. What solutions have you tried so far? Roblox Creator Document

game.Players.PlayerAdded:Connect(function(player)
	print(player.name)
	local Frame = game.StarterGui.PlayerConnectionBox.Frame
	local Name = player.name
	local TweenService = game:GetService("TweenService")
	Frame.Status.Position = UDim2.new(0.098, 0.121)
	
	local info = TweenInfo.new(0.5, Enum.EasingStyle.Bounce, Enum.EasingDirection.In, 4, true, 1)
	
	
	Frame.Status.Text = player.name .. " has joined!"
	
	local Tween = TweenService:Create(info, { Position = UDim2.new(0.098, 5) })
	Tween.Completed:Connect(function(PlayBackState)
		print("Tween".. tostring(PlayBackState))
	end)
	Tween:Play()
	 
end)

I am new to scripting, any help is appreciated!

looks like you forgot that Create() needs 3 arguments.
do
local Tween = TweenService:Create(object, info, {Position = UDim2.new(0.098, 5)})
but define object first. i dont know what object you want to tween.

change this

local Tween = TweenService:Create(info, { Position = UDim2.new(0.098, 5) })

To this

local Tween = TweenService:Create(Frame, info, { Position = UDim2.new(0.098, 5) })

Or whatever you need to change the thing you are tweening to

game.Players.PlayerAdded:Connect(function(player)
	print(player.name)
	local Frame = game.StarterGui.PlayerConnectionBox.Frame
	local Name = player.name
	local TweenService = game:GetService("TweenService")
	Frame.Status.Position = UDim2.new(0.098, 0.121)
	
	local info = TweenInfo.new(0.5, Enum.EasingStyle.Bounce, Enum.EasingDirection.In, 4, true, 1)
	
	
	Frame.Status.Text = player.name .. " has joined!"
	
	local Tween = TweenService:Create(Frame, info, { Position = UDim2.fromOffset(0.098, 5) })
	Tween.Completed:Connect(function(PlayBackState)
		print(`Tween{PlayBackState}`)
	end)
	Tween:Play()
	 
end)

UDim2 has 4 diferrent numbers, for example UDim2.new(x, x, y, y)

even says from the assistance part from roblox
image

1 Like

i changed it to offset, are you happy?

no, not happy
because you haven’t changed anything
but whatever floats your boat. UDim2.new(x, x, y, y)

also i dont know why you would use offset

i did change it, you just didn’t scroll up and right

but the original poster uses .new and not .fromOffset

like shown
image
image

so the OP is who you meant to show him…

nah, i just wanted to tell you that you were doing the .new incorrectly