Touch script not detecting when touched

Hi, I wrote a very simple script to detect when a user “finds” my noob model in a “Find The Button!” game. For some reason, it isn’t adding +1 to the value and it isn’t detecting any touch. “Debug” isn’t being printed in my function. Does anyone know why this is? No errors.

-- || SCRIPT FOR COUNTING NOOBS AND DETECTING WHEN A NOOB IS FOUND
-- < ESSENTIAL FOR THE GAME TO RUN >

-- Variables --

local player = game.Players.LocalPlayer
local level1 = workspace.level1island
local startergui = game:GetService("StarterGui")
local noobcounter = startergui.screenguis.foundamount
local noobcountervalue = noobcounter.Value

-- Stuff --

noobcounter.Text = noobcountervalue

-- Level 1 Noob Counting --

local noob1 = level1.noob1
local noob2 = level1.noob2

noob2.UpperTorso.Touched:Connect(function()
	noobcounter.Value = noobcountervalue.value+1
	print("Debug")
end)

Its because you can’t use Touched event in local script. Try passing that touched event from remote event serverscript to local script.

It could be that you’re referencing the StarterGui, which is what distributes your gui to your PlayerGui.
I would instead use:

local playergui = player.PlayerGui
local noobcounter = playergui.screenguis.foundamount

1 Like