How would I make a decal appear on the screen when a player clicks?

Hello! I am developing a simulator game, and I have a tool. When you click the screen, the tool will give you +3 strength. However, I would like to make it so that a decal appears on screen saying " :muscle: +3" or something like that. Then it disappears after a second. How would I go about making this happen?

2 Likes

If I was you I would just use a ScreenGUI, and then make ImageLabels with your decal on random locations in your ScreenGUI. Then just make them visible / invisible :smiley:

I would get a GUI for thee decal and try scripting random locations the decal can appear. You could make it visible/invisible, but I say that copying the decal is better than making it visible/invisible, since there can be a scenario that the more you click, the more decals pop-out.

I am not great at scripting at all. Do you know how I could script that?

Well, asking for script isn’t good. You should learn and script yourself. If someone makes you a full script, it would be spoonfeeding. You had better hire a scripter to script something like that, not asking on DevForum how to script. We are here to help you with your scripting problems, not to script for you. Hope you understand.

yes, just do

Mouse.Button1Down:Connect (function ()
game.StarterGui.ScreenGui.Visible = true -- or you can do script.parent if the local script is a child of the textLabel
1 Like

Would I need to edit this to make it dissapear too?

If you want it to go away, just do

Wait (1)
game.StarterGui.ScreenGui.TextLabel.Visible = false

Thanks alot. But I want it so that it only appears when the player clicks whilst holding the tool. Would I need to do anything else to make this work or just put this script into the tool?

Oh! If so, then all you need to do is

tool.Activated:Connect(function ()
-- assuming you have already made a variable for the tool. If you havent, do script.Parent and this script goes into a local script child of the tool, not handle.

Do I put these scripts into the GUI or the tool?

Screen Shot 2020-04-09 at 11.42.39

hm, do tool, and dont do the script.Parent for the GUI i told you because then it wont work

Screen Shot 2020-04-09 at 11.48.43

What did I do wrong? Sorry for my lack of scripting knowledge.

Its all good! I was in your position not long ago. Can you add TextLabel to the 3rd line next to screenGui?

This is what is inside my tool.

Screen Shot 2020-04-09 at 11.51.01

1 Like

And, you do not need to add the Mouse.Button1Down as it will then show the gui even if the tool isnt equipped. So get rid of Line 2.

1 Like

I put it as an Image Label rather than text.

1 Like

Screen Shot 2020-04-09 at 11.53.23

Is this better? I noticed the tool and wait are underlined though

u should do a tool as a variable

local tool = game.StarterPack.Weight -- this could be different, idk ur path...

and correct form for wait is:

wait(1)  --without a space

Thanks. I’ve done the whole script now but still nothing appears when I click.

Screen Shot 2020-04-09 at 11.59.05