So I wanted to do a script in which I would spawn a sphere where the player is, and it would take damage and hold them in that Sphere for eight seconds. But It's not working.
local Player = script.Parent.Parent
local mouse = Player:GetMouse()
function YamiCage()
if mouse.Hit ~= nil then
S = Instance.new("Part")
S.BrickColor = BrickColor.new("Really black")
S.Transparency = 0.5
SM = Instance.new("SpecialMesh")
S = SM.Parent
SM.MeshType = "Sphere"
SM.Scale = Vector3.new(1.1, 1.5, 1.5)
S.CFrame = CFrame.new(mouse.Hit.p)
local human = S:FindFirstChild("Humanoid")
if(human ~= nil) then
Humanoid.Health = Health - 2
end
game:GetService("Debris"):AddItem(S, 8)
end
end
mouse.Button1Down:connect(YamiCage)
I need some answers :c
