Could you maybe write some print statements right before the Text line?
Also it could be because you are trying to concatenate instances with string(either on the Amount or ItemName)? Try this print before the line and see what shows up in the output
It says “Number, String” Amount is the Number (Which worked in another game of mine) String is the ItemName I guess.
I think I’m doing something wrong with cloning the Textlabel. but what? (If I had to guess)
This is the Script that Fires the Event:
script.Parent.Triggered:Connect(function(plr)
script.Parent.Enabled = false
script.Parent.Parent.Transparency = 1
script.Parent.Parent.Part.Decal.Transparency = 1
local Amount = 1
local ItemName = "Radiation Scanner"
game.ReplicatedStorage.Basefunc.PickUpItem:FireClient(plr, 1, "Radiation Scanner")
game.ReplicatedStorage.ShowInfo:FireClient(plr, "Press G to use Radiation Scanner.", 5)
script.Parent.Parent.Parent.InvWall_1:Destroy()
script.Parent.Parent:Destroy()
end)
When you clone an instance, its parent is set to NIL so the text label is basically somewhere else but not in the game .
Here is the corrected code:
game.ReplicatedStorage.Basefunc.PickUpItem.OnClientEvent:Connect(function(Amount, ItemName)
--// If Add to Saved Value*
if ItemName == "Radiation Scanner" then
game.ReplicatedStorage.SavingFunc.GotDosimeter:FireServer(Player)
end
--//Show
local Collects = script.Parent.Collects
local Pick = Collects.Example:Clone()
Pick.Parent = Collects.Example.Parent -- Changing its parent from nil to the parent of the instance it was cloned
Pick.Name = "Pickup_" .. ItemName
local PickGetAway = TS:Create(Pick, TI, {TextTransparency = 1})
Pick.TextTransparency = 0
Pick.Text = "Collected " .. Amount .. "x " .. ItemName
SoundStore["Backpack Movement 4 (SFX)"]:Play()
task.wait(3)
PickGetAway:Play()
PickGetAway.Completed:Wait()
Pick:Destroy()
end)
I hope I was useful. If it didn’t work, have questions or I have a mistake feel free to reply!