So I was making a script so I could resize players down to a certain height, just a note I am using R6 and not R15.
So here is my code
local beam = script.Parent.Beam
script.Parent.BrickColor = BrickColor.new("Really red")
beam.Transparency = 1
beam.Color = Color3.fromHSV(0, 255, 255)
local cd = script.Parent.CD
local beam = script.Parent.Beam
local debounce = false
local size = 1
cd.MouseClick:connect(function()
if debounce == false then
beam.Transparency = 0.4
beam.Touched:connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
for i,v in pairs(hit.Parent:GetChildren()) do
if v:IsA("Part") then
v.Size = Vector3.new(size, size, size)
end
end
end
end)
end
end)
im not sure why it kills players.
