Hello developers,
I made a notification system, where clients can send RemoteEvents to the server, the server sends it back to the client, and a notification is shown. Everything works perfectly, but I tried setting this message as a notification:
local notification = "You picked up an item."
And it gives me this error:
Unable to assign property Text. string expected, got Instance.
I tried it with other messages, and everything worked perfectly. What is the issue here? Am I just not realizing something? Any help is greatly appreaciated!
If anyone wants the full scripts, here they are:
Script that sends the notification:
local notification = "You picked up an item."
local colora = 1
local colorb = 1
local colorc = 1
local tme = 5
game.ReplicatedStorage.NotificationEvent:FireServer(player, notification, colora, colorb, colorc, tme)
end
end)
The server script:
game.ReplicatedStorage.NotificationEvent.OnServerEvent:Connect(function(player, notification, colora, colorb ,colorc, tme)
game.ReplicatedStorage.NotificationEvent:FireClient(player, notification, colora, colorb ,colorc, tme)
end)
The script inside the notification frame:
notificationallclientsevent.OnClientEvent:Connect(function(notification, colora, colorb, colorc, tme)
local clone = notificationframe:Clone()
if notification == "" then
clone.AnimationFrame.Notification.Text = "Notification could not be loaded."
else
clone.AnimationFrame.Notification.Text = notification
end
(The rest of the scripts aren’t important.)
Thanks in advance!