Why isnt my coins not = text on the part


local Part = game.Workspace.Part
local PartValue = Part.Value.Value

game.Players.PlayerAdded:Connect(function(joining)

local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = joining

local Coins = Instance.new("IntValue")
Coins.Name = "Coins"
Coins.Value = 3000
Coins.Parent =  leaderstats


PartValue = 200


local Part1 = game.Workspace.Part1
Part.Touched:Connect(function(touched)
	local humanoid = touched.Parent:FindFirstChild("Humanoid")
	if humanoid and PartValue == 200 then
		Part:Destroy()
		Part1.Transparency = 0
		
		local TotalScore = Coins.Value - PartValue
		print(TotalScore)
		Coins.Value = TotalScore
	end
	
	local CollecterCashButton = workspace.Collector
	local CashValueScreen = workspace.Collector.CashValueScreen
	
	CashValueScreen.SurfaceGui.TextLabel.Text = Coins.Value

end)
end)

1 Like

Can you provide any context? (e.g. Any errors, etc. in the output)


Nothing in output

A tycoon trying to put that value into here
image

1 Like

Is it supposed to be Part1.Touched not Part.Touched?