You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to make when a player touches a part a value increase and when i try to access it from a local script it gives me the same value -
What is the issue? Include screenshots / videos if possible!
I used a local script to detect when someone is touching a part then change value -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried searching for someone with the same problem but i found nothing
local Db = {}
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and not Db[hit.Parent] then
Db[hit.Parent] = true
if not game.Players:GetPlayerFromCharacter(hit.Parent) then return end
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
if Player ~= game.Players.LocalPlayer then return end
game.ReplicatedStorage.TNT.Damage.Value += 1
script.Parent:Destroy()
end
end)