This one is a bit of a follow-up from my previous question. I've got a script that makes a Frame with Text appear when a block is clicked (locally, by the way) but for a ClickDetector, I'm pretty sure you can only use a script. So how do I make the script, when noticed the click from the ClickDetector, run the LocalScript? Here's my current Server Script:
local Gui = game.Players.LocalPlayer.PlayerGui.TextInteractions.ComputerText script.Parent.ClickDetector.MouseClick:Connect(function(player) function onClicked () Gui.Visible = true wait(3) Gui.Visible = false end end)
Please point out if things are incorrectly written, by the way! I'm newer to scripting.
LocalScripts
cannot be used in the workspace. And don't use LocalPlayer
for this method. Also, do not use another function within the mouseclick function, it's just a waste of time.
script.Parent.ClickDetector.MouseClick:Connect(function(player) local gui = player.PlayerGui.ScreenGui.ComputerText --wherever it is gui.Visible = true wait(3) gui.Visible = false end)
Please accept my answer if this helped!