Text Not Showing Up

So my Text isn’t Showing up even tho The Sound is playing which is also in the function

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.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)

Thanks! (Yes, The textlabel is set to visible.

5 Likes

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

print(type(Amount), type(ItemName))
1 Like

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)
1 Like

Hmmmm it should of worked though but since it doesn’t want to show the text it couldbe similar to this?

I currently don’t have the time to reply again and look for the problem but who knows

1 Like

I think you forgot to add the parent of Pick.

2 Likes

When you clone an instance, its parent is set to NIL so the text label is basically somewhere else but not in the game :slight_smile:.
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! :slight_smile:

3 Likes

Oh wait you’re right tho, went over my head for some reason lol

3 Likes

Yeah but technically I answered before him :sunglasses:

1 Like

Trust me if it was Possible, both of ya would be the Solution :slight_smile:

1 Like