You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? I need to create a notification system where if it already detects a existing notification, position the notification up by a bit to allow the player to see the new one they just received.
What is the issue? I don’t know how to move it up and it won’t.
What solutions have you tried so far? I have tried already and different methods but its so hard because I don’t receive a error message in the console.
All I want to do is a for i,v in pairs to see if there is any existing notifications in the gui and if there is, move their current Y.Scale. Ehh anyways here’s my code.
local function createNotif(info)
for i,v in pairs(game.Players.LocalPlayer.PlayerGui.NotificationGui:GetChildren()) do
if v.Name == "NotifTemp" then
v.Position = UDim2.new(v.Position.X.Scale, v.Position.X.Offset, v.Position.Y.Scale + .3, v.Position.Y.Offset)
end
end
local Notif = NotificationTemplate:Clone()
Notif.Parent = game.Players.LocalPlayer.PlayerGui:FindFirstChild("NotificationGui")
Notif.TextLabel.Text = "Cannot enter database, we detected suspicious activity from "..info.."."
Notif:TweenPosition(UDim2.new(1, 0, 0.9, 0),"Out","Quint",.5)
wait(10)
Notif:TweenPosition(UDim2.new(2, 0, 0.9, 0),"In","Quint",.5)
wait(1)
Notif:Destroy()
end
I already have the functions and everything setup, I just want to learn how to move it up.
this is probably because 0.3 would be around a third of the screen (because it’s scale). Try changing it to a little above the Y scale for the notification label’s size.
I mean to get the size of the textlabel, (assuming you are using scale.) then adjust the position of the old one. something like this:
local function createNotif(info)
for i,v in pairs(game.Players.LocalPlayer.PlayerGui.NotificationGui:GetChildren()) do
if v.Name == "NotifTemp" then
v.Position = UDim2.new(v.Position.X.Scale, v.Position.X.Offset, v.Position.Y.Scale + v.Size.Y.Scale + .05, v.Position.Y.Offset)
--add the size to the position scale, then add some more so it goes just above the other. (i did it for you btw.)
end
end
local Notif = NotificationTemplate:Clone()
Notif.Parent = game.Players.LocalPlayer.PlayerGui:FindFirstChild("NotificationGui")
Notif.TextLabel.Text = "Cannot enter database, we detected suspicious activity from "..info.."."
Notif:TweenPosition(UDim2.new(1, 0, 0.9, 0),"Out","Quint",.5)
wait(10)
Notif:TweenPosition(UDim2.new(2, 0, 0.9, 0),"In","Quint",.5)
wait(1)
Notif:Destroy()
end