Do you mean you want it to never happen to that player again, but it still works for other players? Or do you mean that it happens for nobody else in the server ever again. Or do you mean that once one player touches it it doesn’t work for anyone across any server?
Add whoever touches the part to a table, and don’t do anything if a certain player touched the part and was found in the table.
For cross server communication, you would have to utilize data stores.
local DataStore = game:GetService("DataStoreService"):GetDataStore("Store")
local block = script.Parent
local Tween = game.TweenService:Create(script.Parent,TweenInfo.new(0.8,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut),{Size = Vector3.new(8.927, 1, 8.756); Transparency = 1})
local blackListedPlayers = {}
local saving = {}
block.Touched:Connect(function(hit)
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent) or game:GetService("Players"):GetPlayerFromCharacter(hit.Parent.Parent)
if not player then
return
end
if blackListedPlayers[player.Name] == nil or DataStore:GetAsync(player.UserId) == nil and saving[player.Name] == nil then
blackListedPlayers[player.Name] = true
saving[player.Name] = true -- If the same player touched
-- the part again, SetAsync will be called again unnecessarily
-- and thus throttle, which isnt ideal at all
DataStore:SetAsync(player.UserId, true)
saving[player.Name] = nil
Tween:Play()
block.Transparency = 0
block.Size = Vector3.new(5.232, 1, 5.323)
end
end)
PS:
You don’t need to destroy the script if you only want the code to run for players who never touched the part.
local datastore = game:GetService("DataStoreService"):GetDataStore("PartTouched")
local block = script.Parent
local debounce = true
local Tween = game.TweenService:Create(script.Parent,TweenInfo.new(0.8,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut),{Size = Vector3.new(8.927, 1, 8.756); Transparency = 1})
block.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChildWhichIsA(“Humanoid”)
if humanoid and debounce == true and not datastore:GetAsync(game.Players:GetPlayerFromCharacter(hit.Parent).UserId) then
datastore:SetAsync(player.UserId, false)
debounce = false
Tween:Play()
block.Transparency = 0
block.Size = Vector3.new(5.232, 1, 5.323)
wait(1)
end
end)
Another consideration is to use a global DataStore, because it is not cross-server exactly. Unfortunately with the information provided, it is still ambiguous what @OP exactly wants.