Dear fellow developers, I have a problem of something I was making. CONCEPT: So, in Roblox studio I’ve made a blackhole, whenever a client goes inside the black hole, in damages and stretch the client until it eventually dies.PROBLEM? However everything was going well, eventually I came across the stretching part, now since I’m not an experience scripter, and I lack of vocabulary and techniques I sadly couldn’t fix the problem, and I would appreciate if you will help me with my problem, thank you for reading this, hopefully I’m not too dumb. Have a good day/evening/night !!! Code:
local p = script.Parent -- describing the part
p.Size = Vector3.new(8.405, 8.405, 8.405) -- size
local function OnTouch(hit) -- when touched
local char = hit.Parent -- defining "char"
local hum = char:FindFirstChild("Humanoid")--defining "humanoid"
if hum then -- "if humanoid touched then"
if hum.Health > 50 then -- if the humanoid health is more than 50 then
hum:TakeDamage(1) -- damage "1"{1}
wait(.5) -- wait
hum:TakeDamage(2) -- damage "2"{2}
wait(.5) -- wait
hum:TakeDamage(3) -- damage"3"{3}
wait(.5) -- wait
hum:TakeDamage(1) -- damage "4"{1}
local weld = Instance.new("Weld") -- new weld
local t = hit.Parent.Torso -- defining "t"
weld.Part0 = t -- part0
weld.Part1 = p---part1
weld.Parent = script.Parent -- the parent of weld is the script's parent
while weld do -- while is welding do
local RA = {hit.Parent:FindFirstChild("Right Arm")} -- defining RA
local LA = {hit.Parent:FindFirstChild("Left Arm")} -- defining LA
local LL = {hit.Parent:FindFirstChild("Left Leg")}-- defining LL
local RL = {hit.Parent:FindFirstChild("Right Leg")}-- defining RL
local H = {hit.Parent:FindFirstChild("Head")} -- defining H
RA.Size = Vector3.new(0.5,1.5,0.5)-- size
LA.Size = Vector3.new(0.5,1.5,0.5)--size
LL.Size = Vector3.new(0.5,3,0.5)--size
RL.Size = Vector3.new(0.5,3,0.5)--size
H.Size = Vector3.new(1,2,1)--size
while char do
wait(5)
hum:TakeDamage(100) --[[ while the player
is stuck in the blackhole, after the player is longer than 5 seconds it loses 100 hp.--]]
end
end
end
end
end
p.Touched:Connect(OnTouch) -- touch event finishing.