One of the arguments for ShowNotification is “messageId” which is supposed to be a string. The problem is that I have no clear indication on what I am supposed to enter here. What is the messageId supposed to be? A number, a GUID?
I’m 100% sure that my script to grab the service is correct, and the script is this:
According to the documentation it says that it is limited to CoreScripts. However the thing is that I am running scripts under a high level context (CoreScript level) and it does not appear to work in live places. However, I am able to use GetService on ToastNotificationService in Studio, the problem being that I am unable to Class security check in Studio.
Somehow, I’d need to find out how to run at CoreScript level in Studio. The service does not appear at all in game, but does appear in Studio. Weird.
This is not true. :FindFirstChild(), :FindFirstChildWhichIsA() or :FindFirstChildOfClass() loop through all children of the given Instance. It will return the first child with the given name or the first child of the given class. If there isn’t a child with this name or of this class, it will return nil. The reason you can use
if Instance:FindFirstChild("String") then
--There is a child called "String".--
end
is because it also runs code inside the if statement if the value isn’t false or nil.
I wrote some messy code to try and locate the service within game. That code being:
function findtheservice()
repeat wait() until game:FindFirstChildOfClass("ToastNotificationService")
return game:WaitForChild("ToastNotificationService")
end
if not game:FindFirstChild("ToastNotificationService") then
print("Failed to locate service") elseif game:FindFirstChild("ToastNotificationService") then print("Located service")
end
The game then proceeded to print “Failed to locate service”.
Therefore, the service is irretrievable in live games, but is retrievable in Studio, for some reason. I’ll need to find a way to run at CoreScript context in Studio to get this working.
I don’t know why I need to even say this. If it’s made for CoreScripts only then it means only CoreScripts can access it. Roblox blocks access to these for a reason.
It seems like using this service basically isn’t possible. On the Developer Hub it says it can only be used for CoreScripts. This means only Roblox can use it.