ok so here is my script.
script.Parent.Touched:Connect(function(h) for i,v in pairs(script.Parent.Folder:GetChildren()) do if v.Value ~= h.Parent.Name and not h.Parent:IsA"Accessory" then k = Instance.new("StringValue",script.Parent.Folder) k.Value = h.Parent.Name h.Parent.Humanoid:TakeDamage(50) end end end)
what im trying to do is spawn a big brick and if the player is in the brick (touches the brick) then i want him to take 50 damage well if he is in it then he keeps taking 50 damage and i dont want that to happen right now im trying to setup a for loop and try to save the players names of who got damaged but that kind of failed lol. anyone else have maby another way of doing this? or fixing my script maby?
Expanding on "INOOBE_YT"'s comment, Check if the player is hit by the brick, then store their name for example in a table, and check if the player is in there. If they are, don't deal damage to them.