So I’m making a notification gui that you are able to create a notification through a remote event. For some reason when I’m firing it to tell the player what Item they have just picked up it returns nil for the text I’m sending. Here’s the scripts:
Notification creation script:
game.ReplicatedStorage.NotifEvent.OnClientEvent:Connect(function(name, text)
print(text)
print(name)
local clone = script.Parent.Template:Clone()
clone.Name = name
clone.Text = text..name
clone.Visible = true
clone.Parent = script.Parent
end)
Pickup script (script firing remote event):
script.Parent.ProximityPrompt.Triggered:Connect(function(player)
local Item = script.Parent.Parent
local Artifact = script.Parent.Parent.AName.Value
local Amount = script.Parent.Parent.Amount.Value
game.ReplicatedStorage.PickupArtifact:FireClient(player, Item)
local Value = Instance.new("IntValue")
Value.Name = Artifact
Value.Value = Amount
Value.Parent = player.AllArtifacts
local Clone = Value:Clone()
Value.Name = Artifact
Value.Value = Amount
Clone.Parent = player.Artifacts
game.ReplicatedStorage.NotifEvent:FireClient(player, Item.Name, "Picked up ")
end)
The weirdest thing about this is that I’m firing the same remote event in the same format in another script when the player sells an item, and that works just fine. Here’s that:
game.ReplicatedStorage.SellArtifact.OnServerEvent:Connect(function(player, artifact)
local Cash = player.leaderstats.Bucks
Cash.Value += artifact.Value
game.ReplicatedStorage.NotifEvent:FireClient(player, artifact.Name, "Sold ")
artifact:Destroy()
end)
The picking up an item script makes the notification creation script print nil for the text.
Sorry if this didn’t make sense lol, I typed this pretty fast.