Hello! (This is my first time time posting on the DevForum, so go easy on me please.)
So, I’m fairly new to scripting, but know some of the basics. So, I’m making a script where if you click on it, it takes you to the creature you chose. But, the ClickDetector isn’t working. I originally had the script outside the ClickDetector, but I put it in the ClickDetector and nothing has changed. It prints hello
but when I click on a button, it does not work. I don’t know if anyone has done this topic exactly like I have. I looked up many other topics, but none matched. Maybe it’s because it’s in PlayerGui?
Here’s the code:
--LOCALS--
local Player = game.Players.LocalPlayer
local VP = script.Parent.Parent
local Base = game.Workspace.Base
local Cam = game.Workspace.CurrentCamera
local ClickDetect = script.Parent
-- TEST--
Print("Hello")
--SETUP--
ClickDetect.MouseClick:connect(function(OnClick) --Button1
print("ClickStarted")
end)
And here is where it’s located:
It’s located in every ClickDetector, the ClickDetector is in the button, the Button is in the ViewportFrame. This goes for every ViewportFrame.