Hi, I am trying to make a script that once you click on specific part it fires event, but it dosent do anything no output no errors Here is Event listener
local player = game.Players.LocalPlayer
game.ReplicatedStorage.GiveIng1.OnClientEvent:Connect(function(player)
print("mmm")
player.Item.Value = 1
player.InvSpace = true
end)
Here is that thing that should fire it.
script.Parent.Parent.ClickDetector.MouseClick:Connect(function(hit)
local name = hit.Name
local character = workspace:WaitForChild(name)
local player = game.Players:GetPlayerFromCharacter(character)
game.ReplicatedStorage.GiveIng1:FireClient(player)
print("clicked")
end)
I hope you can help me.

10 comments
I'm sorry, what are you trying to do? You need to specific on what you are trying to do. Just saying 'Remote event doesn't work' isn't descriptive enough.
Can't you just get the character from hit.Parent?
@CrypxticDoge hit is basically the character. You don't need hit.Parent.
I want my remote event fire once i click on part but once i click the first script i guess works fine i am not sure but the event listener dosent print anything what its suposed to do.
Try using breakpoints to debug
I'm saying what you are trying to accomplish. What is your goal? Are you trying to change values in a client? If so, that is not a good idea.
There is no need for the variables name and character, you can just use GetPlayerFromCharacter(Hit)
@kistupas12344 Why do you need to use a RemoteEvent? You can just change it in the server script.
So how do i change insde player values?
Remove the player parameter from the OnClientInvoke script.