Gui wont' show when I clone it

The gui won’t show no matter what, I clone it from replicated storage and put it into player gui. If it makes a difference I’m firing the bindeable from the command box when the game is being played

local re = game:GetService("ReplicatedStorage")
local text = re.EatEffect
local bindeables = re.Bindeables
local effectEvent = bindeables.PlayEffect

effectEvent.Event:Connect(function(amount)
	local effect = text:Clone()
	effect.Parent = game.Players.LocalPlayer.PlayerGui.ScreenGui
	effect.Visible = true
	effect.Text = "+"..amount.." Coins"
	effect.Position = UDim2.new(math.random(-50, 50), math.random(-50, 50))
	effect:TweenPosition(UDim2.new(0, 325,1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, false)
end)

Why are you firing a bindable event?

If you intend the GUI to appear when the player joins the game, localscripts will already do that.
If anything is nil, you should add :WaitForChild() and wait for that object.

Also, Udim2 takes four arguments, not two. So your position is also being set incorrectly. Try fixing it to be `UDim2.new(0, math.random(-50,50), 0, math.random(-50,50))

Yo it actually worked tysm, I’ve been trying to fix this for like an hour lol

All good bro, I suggest you ask AI in the future. Its a great tool for beginners and can help you catch these small mistakes quickly and help you remember.

Thanks, I’m not exactly a beginner I just suck at guis, and some guy told me to use a bindeable lol

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