If this script is a LocalScript, it's a mistake.
If this script is a Script, i'ts okay. But you don't can use game.Player.LocalPlayer whith the server, because the server is not a client.
To make it, you do need used RemoteEvent.
ServerScript:
local Debounce = true
script.Parent.Touched:Connect(function(hit)
local Player = game:GetService('Players'):GetPlayerFromCharacter(hit.Parent)
if Player and Debounce then
Debounce = false
game:GetService('ReplicatedStorage').RemoteEvent:FireClient(Player)
script.Parent:Destroy()
end
end)
LocalScript:
local Player = game:GetService('Players').LocalPlayer
local PlayerGui = Player:WaitForChild('PlayerGui')
local CollectionCoin = PlayerGui:WaitForChild('CollectionCoinRocketGui')
game:GetService('ReplicatedStorage').RemoteEvent.OnClientEvent:Connect(function()
CollectionCoin.Frame.TextBox.iValue.Value = CollectionCoin.Frame.TextBox.iValue.Value + 1
CollectionCoin.Frame.TextBox.Text = CollectionCoin.Frame.TextBox.Text
end)