Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Trying to make like a blast radius type thing but i cant quite figure out how to make the script?

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?

1 comment

1

Use magnitude and a table to store the already hit player's name

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.