Hi, this is my script i have right now

local Players = game:GetService("Players")
local TouchPart = workspace.Part 
local RESET_SECONDS = 1.3
local isTouched = false
local player = game:GetService("Players")
local teams = game:GetService("Teams")


TouchPart.Touched:Connect(function(touched)
	if touched.Parent:IsA("Model") and touched.Parent:FindFirstChild("Humanoid") then
		local Player = Players:GetPlayerFromCharacter(touched.Parent)
		if Player then
			if not isTouched then
				isTouched = true
				if Player.leaderstats.Cotton.Value <= 0 then
					print("You dont have any cotton")
					wait(RESET_SECONDS)
					isTouched = false
				else 
					local leaderstats = Player.leaderstats -- from here
					local Notes = leaderstats and leaderstats:FindFirstChild("Cotton")
					if Notes then
						
						teams.Owner.PlayerAdded.Notes.Value = teams.Owner.PlayerAdded.leaderstats.Notes.Value + Notes.Value
						Notes.Value = Notes.Value - Notes.Value -- to here
						
					 
						
					end
				end
			end
		end
	end
	end)

and all i am getting in output is "Notes is not a valid member of RBXScriptSignal"

2 comments

0

which line is it saying "Notes is not a valid member or RBXScriptSignal"?

0

local Notes = leaderstats and ??