I want to make it so when you press a button text and a image pops up telling you how many points you earned. I want it to say the amount of points you earned and a custom image i have.

This is what i have so far:

cp = 0
local plr = game.Players.LocalPlayer
while wait() do
	if cp ~= plr.leaderstats.clicks.Value then
		local random = math.random(1,900)
		local xnew = random/1000
		local new = game.ReplicatedStorage.ShowAdd:Clone()
		new.Parent = script.Parent.ScreenGui
		new.Position = UDim2.new(xnew,0,1,0)
		
		new.text = "+"..plr.leaderstats.clicks.Value - cp..""
		cp = plr.leaderstats.clicks.value
	end
end

Im also getting this error

12:13:02.293 - ScreenGui is not a valid member of PlayerGui "Players.ItzSulfonic.PlayerGui"

18 comments

0

Local script or server script?

0

local

0

Did you notice on line 12 that it's "value" and not "Value" (The "v" is supposed to be captialized)

0

whoops, i changed it

0

Does it work now? Also, what are your GUI's in PlayerGui?

0

why are u cloning it from rep storage?

0

So he could repeat that process again instead of getting an error saying that it doesn't exist. That's also why it's called "REPLICATED storage"

0

no im still getting the same error, and all i have in my gui is a menu and that script.

0

Whats the name of the menu, is it "ScreenGui"? Also, when you play the game, you can look into your PlayerGui and see what's in there.

0

oh now i see, in playergui i have guis named 'Main' "chat "freecam" and "bubblechat" main is what i use for my guis

0

And what's in Main?

0

a couple frames and image buttons

0

The names of them and there children's name

0

Clicks > clicks, image label, textboxt Gems> gems, image label, textbox rebirths click>click script

0

Welp, ScreenGui isn't in that right? If it not then I don't know what to say.

0

i tried changing the "main" gui name to ScreenGui now im getting a different error "text is not a valid member of TextLabel" idk what to do at this point and cant find nothing online

0

If you want to know more about GUI's, then go watch these videos: https://www.youtube.com/watch?v=4yeeGnEBzFY&list=PLhieaQmOk7nK9ob348Yc_PTcIyHjDCnem

0

alright thanks for trying