Please consider formatting your code so that it looks proper & more easier to see, you can use 3 backticks (`) to accomplish this
` ` ` -- Not spaced out
This is a code block!
` ` ` -- End the code here
You have to add a conditional check to make sure that the Player you’re attempting to find, is not equal to nil cause chances are you could be passing through a nil value if there isn’t a valid Player
Also,
There’s no need to pass through the LocalPlayer when using OnClientEvent, as you can easily obtain it in a LocalScript alone
You’re also changing your debounce variable way too early, so it’s frequently triggering every so often which results in instantaneous changes nonstop
-- Server Side
local Part = script.Parent
local vivyt = true
local limbaranst = game.ReplicatedStorage.posign.glasnotively
Part.Touched:Connect(function(hit)
local Target = hit.Parent
if not Target then return end
local Plr = game.Players:GetPlayerFromCharacter(Target)
if Plr ~= nil and vivyt then
local Chingua = Plr:WaitForChild("Chingua")
vivyt = false
Chingua.Value = Part.Name
limbaranst:FireClient(Plr, Chingua.Value)
task.wait(1)
vivyt = true
end
end)
-- Local Side
local Plr = game.Players.LocalPlayer
local kamnas = game.ReplicatedStorage.posign.glasnotively
kamnas.OnClientEvent:Connect(function(haiu)
print("neva "…tostring(haiu))
print("neva "…Plr.Chingua.Value)
end)