Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago

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
Use magnitude and a table to store the already hit player's name INOOBE_YT 387 — 6y

1 answer

Log in to vote
0
Answered by
H4X0MSYT 536 Moderation Voter
6 years ago

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.

Ad

Answer this question