Hello, this script allows players that when he touches a part then an animation appears on the screen, the problem is that when a player touches the part, the animation appears for all players in the server, while I would like it to appear only for the player. I have tried different scripts to fix the problem but each time it makes this script malfunction. Thank you
--Server Script in ServerScriptService
game.ReplicatedStorage.Nametag.OnServerEvent:Connect(function(plr)
for i,v in pairs(game.Workspace.Creatures:GetChildren()) do
if v:IsA("Part") then
if game.Workspace.Creatures[v.Name] then
if v then
v.Touched:Connect(function()
if plr:WaitForChild("Creatures") then
if not plr:WaitForChild("Creatures"):FindFirstChild(v.Name) then
local newval = Instance.new("BoolValue")
newval.Name = v.Name
newval.Parent = plr:WaitForChild("Creatures")
local GUI = game.Workspace.Creatures.CollectWolf
local info = game.Workspace.Creatures[v.Name]
GUI.WolfImage.Image = info.Image3.Value
GUI.WolfName.Text = info.Name3.Value
GUI.WolfName.TextColor3 = Color3.new(1, 1, 0)
local GUI2 = GUI:Clone()
GUI2.Parent = plr.PlayerGui
wait(4)
GUI2:Destroy()
end
end
end)
end
end
end
end
end)