When touching object my gui should go up by 1. Isnt working

This one is a normal script on the part

local playersService = game:GetService("Players")
script.Parent.Touched:Connect(function(partTouched)
  if partTouched.Parent:FindFirstChild("Humanoid") then
        local player = playersService:GetPlayerFromCharacter(partTouched.Parent)
	if player then
		player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + 1
                script.Parent:Destroy()
	end
end
end)

this one is inside the coin text as a local script

local player = game.Players.LocalPlayer
player.leaderstats.Coins:GetPropertyChangedSignal("Value"):Connect(function()
    script.Parent.Text = player.leaderstats.Coins.Value
end)

image
image
image

I’m not 100% sure it’ll work, but try this instead:

player.leaderstats.Coins.Value = player.leaderstats.Coins.Value += 1

You leaderstats is not a folder, but an IntValue.

You have a typo it would be:
player.leaderstats.Coins.Value += 1
But this is just a shorter, more readable version of OP’s way, however, this will not fix the error

How can i make it to a folder from an int value

doesnt work sadly but thanks for trying

Can you show your leaderstats script. Then I can correct it for you

My leaderstats can you just clarify which 1 your talking about. Sorry im still learning scripting.

The script, it should be in ServerScriptService and it should be creating something when the player joins called leaderstats

i actually havent got anything lol. I had a problem with a script so this other guy showed me this script.

Anything you think that may fix it?

@LuckyPlanetsAlt1 Did you also try this?

I will try it now thank you! Thanks for your time

No sadly not
image

I don’t get what you mean by this. can you go to the view tab (in studios) and click the find all tool and search leaderstats and open every script it has a result in

image
Havent got anything in Server script service (no scripts)

Open the CurrencyHandler and paste the contents here

The Currency Handler hasnt got any scripts so what do i paste.