Health script.

i need some help.

i have been making a horror game and my character is supposed to die on touch

problem #1: i cant figure out the death on touch script
problem #2: my health script wont work

here is my health script

var curHealth : int = 100;
var maxHealth : int = 100;

function Start () {
}

function Update () {

    if(curHealth < 0 ) {
            curHealth = 0;
    }

    if(curHealth > 100) {
            curHealth = 100;
    }

    if(curHealth > 0) {
            Destroy(Player);
    
    }

}

wait(2)
local InputService=game:GetService(“UserInputService”)
local Camera=game.Workspace.CurrentCamera
local Player=game.Players.LocalPlayer
local Character=Player.Character
local Head=Character.Head
local Torso=Character.Torso
local RootPart=Character.HumanoidRootPart
local RootJoint=RootPart.RootJoint
local Neck=Torso.Neck
Camera.FieldOfView=90
Camera.CameraType=“Scriptable”
InputService.MouseBehavior = Enum.MouseBehavior.LockCenter

local v3=Vector3.new
local cf=CFrame.new
local components=cf().components
local inverse=cf().inverse
local fromAxisAngle=CFrame.fromAxisAngle
local atan,atan2=math.atan,math.atan2
local acos=math.acos

local function toAxisAngleFromVector(v)
local z=v.z
return zz<0.99999 and v3(v.y,-v.x,0).unitacos(-z) or v3()
end

local function AxisAngleLookOrientation(c,v,t)–CFrame,Vector,Tween
local c=c-c.p
local rv=(inverse(c)v).unit
local rz=rv.z
return rz
rz<0.99999 and cfromAxisAngle(v3(rv.y,-rv.x,0),acos(-rz)(t or 1)) or c
end

local function AxisAngleLookNew(v,t)–CFrame,Vector,Tween
local rv=v.unit
local rz=rv.z
return rzrz<0.99999 and fromAxisAngle(v3(rv.y,-rv.x,0),acos(-rz)(t or 1)) or cf()
end

local function AxisAngleLook(c,v,t)–CFrame,Vector,Tween
local rv=(inverse(c)v).unit
local rz=rv.z
return rz
rz<0.99999 and cfromAxisAngle(v3(rv.y,-rv.x,0),acos(-rz)(t or 1)) or c
end

local Sensitivity=0.005

local CameraDirection=Vector3.new(0,0,1)

local function EulerAnglesYX(l)
local x,z=l.x,l.z
return atan(l.y/(xx+zz)^0.5),-atan2(x,-z)
end

local function AnglesXY(l)
local z=l.z
return atan2(l.y,-z),-atan2(l.x,-z)
end

local function MouseMoved(Input)
if Input.UserInputType==Enum.UserInputType.MouseMovement then
local dx,dy=Input.Delta.xSensitivity,Input.Delta.ySensitivity
local m2=dxdx+dydy
if m2>0 then
CameraDirection=(AxisAngleLookOrientation(RootPart.CFrame,CameraDirection)fromAxisAngle(v3(-dy,-dx,0),m2^0.5)).lookVector
end
local RootOrientation=RootPart.CFrame-RootPart.Position
local RelativeDirection=RootOrientation:inverse()CameraDirection
local AngX,AngY=AnglesXY(RelativeDirection)–RootOrientation:inverse()

if AngX<-1.57
11/12 then
local y,z,c,s=RelativeDirection.y,RelativeDirection.z,math.cos(-1.5711/12-AngX),-math.sin(-1.5711/12-AngX)
z,y=zc-ys,zs+yc
CameraDirection=RootOrientationv3(RelativeDirection.x<0 and -(1-yy-zz)^0.5 or (1-yy-zz)^0.5,y,z)
elseif AngX>1.57
11/12 then
local y,z,c,s=RelativeDirection.y,RelativeDirection.z,math.cos(1.5711/12-AngX),-math.sin(1.5711/12-AngX)
z,y=zc-ys,zs+yc
CameraDirection=RootOrientationv3(RelativeDirection.x<0 and -(1-yy-zz)^0.5 or (1-yy-z*z)^0.5,y,z)
end
end
end

local Mouse=Player:GetMouse()

local Zoom=- 3

Mouse.KeyDown:connect(function(k)
if k==“e” then
Zoom=- -3
elseif k==“q” then
Zoom=- 1
elseif k==“t” then
Zoom=- 3.11
elseif k==“m” then
local s = Instance.new(“Sound”)
s.Name = “BGMusic”
s.SoundId = “http://www.roblox.com/asset/?id=857499889
s.Pitch = 1
s.Volume = 1
s.Looped = true
s.archivable = false
s.Parent = game.Workspace
wait(0.1)
s:play()
elseif k==“l” then
–time blast Gifted by invaderzimfan1233, Local Script!

math.randomseed(tick())
local pwn = game:service(‘Players’).LocalPlayer
local char = pwn.Character
local pk = pwn.Backpack
local Human = char.Humanoid
local Torso = char.Torso
local Head = char.Head
local LeftArm = char[“Left Arm”]
local RightArm = char[“Right Arm”]
local LeftLeg = char[“Left Leg”]
local RightLeg = char[“Right Leg”]
local Neck = char.Torso[“Neck”]
local RightShoulder = char.Torso[“Right Shoulder”]
local LeftShoulder = char.Torso[“Left Shoulder”]
local RightHip = char.Torso[“Right Hip”]
local LeftHip = char.Torso[“Left Hip”]
local NeckC0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
local NeckC1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
local LeftShoulderC0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
local LeftShoulderC1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
local RightShoulderC0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
local RightShoulderC1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
local LeftHipC0 = CFrame.new(-1, -1, 0, 0, 0, -1,0,1, 0, 1, 0, 0)
local LeftHipC1 = CFrame.new(-0.5,1,0,0,0,-1,0,1,0,1, 0, 0)
local RightHipC0 = CFrame.new(1,-1,0,0,0,1,0,1,0,-1,0,0)
local RightHipC1 = CFrame.new(0.5,1,0,0,0,1,0,1,0,-1,0,0)
local Tewl = Instance.new(“HopperBin”,pk)
local Nim = “Time Blast”
local disabled = false
function ChargeWelds()
if Torso.Anchored then
Torso.CFrame = Torso.CFrame * CFrame.new(0,5,0)
else
Torso.Anchored = true
Torso.CFrame = Torso.CFrame * CFrame.new(0,5,0)
end
coroutine.resume(meshInsertion)
TiltX = 2
TiltY = 0
TiltZ = 2
RightShoulder.C0 = RightShoulderC0 * CFrame.Angles(TiltX, TiltY, TiltZ)
LeftShoulder.C0 = LeftShoulderC0 * CFrame.Angles(TiltX, TiltY, TiltZ)
TiltX = 2
TiltY = 0
TiltZ = 2
MoveX = 0
MoveY = 0
MoveZ = 0
RightShoulder.C0 = RightShoulder.C0 * CFrame.Angles(TiltX, TiltY, TiltZ) * CFrame.new(MoveX, MoveY, MoveZ)
LeftShoulder.C0 = LeftShoulder.C0 * CFrame.Angles(TiltX, TiltY, TiltZ) * CFrame.new(MoveX,MoveY,MoveZ)
TiltX = 0.3
TiltY = 0
TiltZ = 0.3
MoveX = 0
MoveY = 0
MoveZ = 0
RightHip.C0 = RightHipC0 * CFrame.Angles(TiltX, TiltY, TiltZ) * CFrame.new(MoveX, MoveY, MoveZ)
LeftHip.C0 = LeftHipC0 * CFrame.Angles(TiltX, TiltY, TiltZ) * CFrame.new(MoveX, MoveY, MoveZ)
end
function RefreshWelds()
Neck.C0 = NeckC0
Neck.C1 = NeckC1
RightShoulder.C0 = RightShoulderC0
RightShoulder.C1 = RightShoulderC1
LeftShoulder.C0 = LeftShoulderC0
LeftShoulder.C1 = LeftShoulderC1
RightHip.C0 = RightHipC0
RightHip.C1 = RightHipC1
LeftHip.C0 = LeftHipC0
LeftHip.C1 = LeftHipC1
end
function Welds1()
TiltX = 0
TiltY = 0
TiltZ = 1.57
RightShoulder.C0 = RightShoulderC0 * CFrame.Angles(TiltX, TiltY, TiltZ)
LeftShoulder.C0 = LeftShoulderC0 * CFrame.Angles(TiltX, TiltY, -TiltZ)
TiltX = 0.6
TiltY = 0
TiltZ = 0
MoveX = 0
MoveY = 0
MoveZ = -0.3
RightShoulder.C0 = RightShoulder.C0 * CFrame.Angles(TiltX, TiltY, TiltZ) * CFrame.new(MoveX, MoveY, MoveZ)
LeftShoulder.C0 = LeftShoulder.C0 * CFrame.Angles(TiltX, TiltY, TiltZ) * CFrame.new(MoveX, MoveY, MoveZ)
TiltX = -0.05
TiltY = 0
TiltZ = 0
MoveX = 0
MoveY = 0.1
MoveZ = 0
RightHip.C0 = RightHipC0 * CFrame.Angles(TiltX, TiltY, TiltZ) * CFrame.new(MoveX, MoveY, MoveZ)
LeftHip.C0 = LeftHipC0 * CFrame.Angles(TiltX, TiltY, TiltZ) * CFrame.new(MoveX, MoveY, MoveZ)
end
function Welds2()
TiltX = 100
TiltY = 20
TiltZ = -20
RightShoulder.C0 = RightShoulderC0 * CFrame.Angles(TiltX, TiltY, TiltZ)
LeftShoulder.C0 = LeftShoulderC0 * CFrame.Angles(TiltX, TiltY, TiltZ)
TiltX = 0.6
TiltY = 0
TiltZ = 0
MoveX = 0
MoveY = 0
MoveZ = -0.3
RightShoulder.C0 = RightShoulder.C0 * CFrame.Angles(TiltX, TiltY, TiltZ) * CFrame.new(MoveX, MoveY, MoveZ)
LeftShoulder.C0 = LeftShoulder.C0 * CFrame.Angles(TiltX, TiltY, TiltZ) * CFrame.new(MoveX, MoveY, MoveZ)
TiltX = 0
TiltY = 0
TiltZ = 0
MoveX = 0
MoveY = 0
MoveZ = 0
RightHip.C0 = RightHipC0 * CFrame.Angles(TiltX, TiltY, TiltZ) * CFrame.new(MoveX, MoveY, MoveZ)
LeftHip.C0 = LeftHipC0 * CFrame.Angles(TiltX, TiltY, TiltZ) * CFrame.new(MoveX, MoveY, MoveZ)
end
function onButton1Down(mouse)
if disabled == true then
return
end
Torso.Anchored = true
Human.PlatformStand = true
Human.WalkSpeed = 0
disabled = true
narb = Instance.new(“ForceField”,char)
noob = narb:clone()
noobz = narb:clone()
nubz = narb:clone()
coroutine.resume(coroutine.create(function()
for x = 1,150 do
Torso.CFrame = Torso.CFrame * CFrame.fromEulerAnglesXYZ(0,math.random(-100,100),0)
wait()
end
end))
chargeup()
local wow = Instance.new(“Part”,workspace)
wow.Anchored = true
wow.CanCollide = false
wow.Reflectance = 0.32
wow.formFactor = “Custom”
wow.Size = Vector3.new(0.2,0.2,0.2)
wow.TopSurface = “Smooth”
wow.Transparency = 0
wow.BottomSurface = “Smooth”
wow.CFrame = Torso.CFrame
wow.BrickColor = BrickColor.new(“Institutional white”)
local Mesh2 = Instance.new(“SpecialMesh”,wow)
Mesh2.MeshType = “FileMesh”
Mesh2.Scale = Vector3.new(4.5,0.5,4.5)
Mesh2.MeshId = “http://www.roblox.com/asset/?id=20329976
Mesh2.TextureId = “”
for i = 1,30 do
wow.CFrame = Torso.CFrame * CFrame.new(0,-7.5,0)
wait()
wow.CFrame = wow.CFrame * CFrame.fromEulerAnglesXYZ(0,-6,0)
wow.Transparency = wow.Transparency + 0.1
end
local p = Instance.new(“Part”,char)
p.Anchored = true
p.CanCollide = false
p.Transparency = 0
p.Reflectance = 0.3
p.formFactor = “Symmetric”
p.Size = Vector3.new(12, 12, 12)
p.TopSurface = “Smooth”
p.BottomSurface = “Smooth”
p.Name = “Sharingan”
p.Shape = “Ball”
p.CFrame = Torso.CFrame
p.BrickColor = BrickColor.new(“Cyan”)
local lol = Instance.new(“Explosion”,workspace)
lol.Position = Torso.Position
lol.BlastRadius = 450
lol.BlastPressure = 0
for i = 1,10 do
wait()
p.Size = p.Size + Vector3.new(3,3,3)
p.CFrame = Torso.CFrame
p.Transparency = p.Transparency + 0.1
end
game.Lighting.TimeOfDay = 6
p:remove()
wow:remove()
Welds2()
wait(0.5)
Welds1()
wait(0.5)
RightShoulder.C0 = RightShoulderC0 * CFrame.Angles(0.1, 0, 2)
LeftShoulder.C0 = LeftShoulderC0 * CFrame.Angles(0.1, 0, -2)
wait(1)
for i = 1,20 do
game.Lighting.Ambient = Color3.new(math.random(),math.random(),math.random())
wait()
end
game.Lighting.Ambient = Color3.new(1,1,1)
local model = Instance.new(“Model”,char)
local fer = Instance.new(“Fire”,Torso)
fer.Size = 30
fer.Heat = 18
fer.Color = BrickColor.new(“Institutional white”).Color
fer.SecondaryColor = BrickColor.new(“Really black”).Color
local smk = Instance.new(“Smoke”,Torso)
smk.Opacity = 1
smk.RiseVelocity = 25
smk.Size = 12
smk.Color = BrickColor.new(“Cyan”).Color
local O = Instance.new(“Part”,model)
O.Anchored = true
O.CanCollide = false
O.Transparency = 0
O.Reflectance = 0.3
O.formFactor = “Symmetric”
O.Size = Vector3.new(0, 0, 0)
O.TopSurface = “Smooth”
O.BottomSurface = “Smooth”
O.Name = “Sharingan”
O.Shape = “Ball”
O.CFrame = Torso.CFrameCFrame.fromEulerAnglesXYZ(1.5, 0, 0)
O.BrickColor = BrickColor.new(“Really red”)
local Mesh = Instance.new(“SpecialMesh”)
Mesh.Parent = O
Mesh.MeshType = “FileMesh”
Mesh.Scale = Vector3.new(1.3, 1.3, 1.3)
Mesh.MeshId = “http://www.roblox.com/asset/?id=3270017
Mesh.TextureId = “”
local O2 = Instance.new(“Part”,model)
O2.Anchored = true
O2.CanCollide = false
O2.Transparency = 0
O2.Reflectance = 0.3
O2.formFactor = “Symmetric”
O2.Size = Vector3.new(0, 0, 0)
O2.TopSurface = “Smooth”
O2.BottomSurface = “Smooth”
O2.Name = “Sharingan”
O2.Shape = “Ball”
O2.CFrame = Torso.CFrame
O2.BrickColor = BrickColor.new(“Institutional white”)
local Mesh3 = Instance.new(“SpecialMesh”)
Mesh3.Parent = O2
Mesh3.MeshType = “FileMesh”
Mesh3.Scale = Vector3.new(1, 1, 1)
Mesh3.MeshId = “http://www.roblox.com/asset/?id=3270017
Mesh3.TextureId = “”
local O3 = Instance.new(“Part”,model)
O3.Anchored = true
O3.CanCollide = false
O3.Transparency = 0
O3.Reflectance = 0.3
O3.formFactor = “Symmetric”
O3.Size = Vector3.new(0, 0, 0)
O3.TopSurface = “Smooth”
O3.BottomSurface = “Smooth”
O3.Name = “Sharingan”
O3.Shape = “Ball”
O3.CFrame = Torso.CFrame
CFrame.fromEulerAnglesXYZ(1.5, 0, 0)
O3.BrickColor = BrickColor.new(“Cyan”)
local Mesh4 = Instance.new(“SpecialMesh”)
Mesh4.Parent = O3
Mesh4.MeshType = “FileMesh”
Mesh4.Scale = Vector3.new(1.3, 1.3, 1.3)
Mesh4.MeshId = “http://www.roblox.com/asset/?id=3270017
Mesh4.TextureId = “”
local O4 = Instance.new(“Part”,model)
O4.Anchored = true
O4.CanCollide = false
O4.Transparency = 0
O4.Reflectance = 0.3
O4.formFactor = “Symmetric”
O4.Size = Vector3.new(0, 0, 0)
O4.TopSurface = “Smooth”
O4.BottomSurface = “Smooth”
O4.Name = “Sharingan”
O4.Shape = “Ball”
O4.CFrame = Torso.CFrame
O4.BrickColor = BrickColor.new(“Institutional white”)
local Mesh5 = Instance.new(“SpecialMesh”)
Mesh5.Parent = O4
Mesh5.MeshType = “FileMesh”
Mesh5.Scale = Vector3.new(1, 1, 1)
Mesh5.MeshId = “http://www.roblox.com/asset/?id=3270017
Mesh5.TextureId = “”
local pro = Instance.new(“Part”,char)
pro.Anchored = true
pro.CanCollide = true
pro.Transparency = 0.2
pro.Reflectance = 0.3
pro.formFactor = “Symmetric”
pro.Size = Vector3.new(1, 1, 1)
pro.TopSurface = “Smooth”
pro.BottomSurface = “Smooth”
pro.Name = “Sharingan”
pro.Shape = “Ball”
pro.BrickColor = BrickColor.new(“Cyan”)
pro.CFrame = Torso.CFrame
pro.Touched:connect(onTouched)
local lol = Instance.new(“Explosion”,workspace)
lol.Position = Torso.Position
lol.BlastRadius = 65
lol.BlastPressure = 900000
lol.Hit:connect(explhit)
local Effect = Instance.new(“Part”,pro)
Effect.Anchored = true
Effect.CanCollide = false
Effect.Size = Vector3.new(1, 1, 1)
Effect.formFactor = “Symmetric”
Effect.Transparency = 0.6
Effect.BrickColor = BrickColor.new(“Institutional white”)
Effect.CFrame = Torso.CFrame
Effect.Reflectance = 0.6
Effect.TopSurface = “Smooth”
Effect.BottomSurface = “Smooth”
local EffectMesh = Instance.new(“CylinderMesh”,Effect)
EffectMesh.Scale = Vector3.new(3, 90000, 3)
local effect = Effect:Clone()
local effectmesh = EffectMesh:Clone()
effect.Parent = pro
effectmesh.Parent = effect
for i = 1,75 do
effect.Reflectance = math.random()
Effect.Reflectance = math.random()
effectmesh.Scale = effectmesh.Scale + Vector3.new(1,0,1)
EffectMesh.Scale = EffectMesh.Scale + Vector3.new(2,0,2)
Mesh.Scale = Mesh.Scale + Vector3.new(3, 3, 3)
Mesh3.Scale = Mesh.Scale
Mesh4.Scale = Mesh.Scale
Mesh5.Scale = Mesh.Scale
O.CFrame = O.CFrame * CFrame.fromEulerAnglesXYZ(6,0,0)
O2.CFrame = O2.CFrame * CFrame.fromEulerAnglesXYZ(0,6,0)
O3.CFrame = O3.CFrame * CFrame.fromEulerAnglesXYZ(0,6,6)
O4.CFrame = O4.CFrame * CFrame.fromEulerAnglesXYZ(6,0,6)
pro.Size = pro.Size + Vector3.new(3,3,3)
pro.CFrame = Torso.CFrame
O.BrickColor = BrickColor.new(“Really red”)
O2.BrickColor = BrickColor.new(“Cyan”)
O3.BrickColor = BrickColor.new(“Institutional white”)
O4.BrickColor = BrickColor.new(“Really black”)
pro.BrickColor = BrickColor.new(“Hot pink”)
wait()
end
coroutine.resume(core)
for i = 1,10 do
Effect.Reflectance = 0 + 0.1
effect.Reflectance = 0 + 0.1
EffectMesh.Scale = EffectMesh.Scale - Vector3.new(12,30,12)
effectmesh.Scale = effectmesh.Scale - Vector3.new(11,29,11)
O.Transparency = O.Transparency + 0.1
O2.Transparency = O2.Transparency + 0.1
O3.Transparency = O3.Transparency + 0.1
O4.Transparency = O4.Transparency + 0.1
pro.Transparency = p.Transparency + 0.01
wait()
end
Effect:remove()
pro:remove()
fer:remove()
smk:remove()
noob:remove()
noobz:remove()
nubz:remove()
narb:remove()
RefreshWelds()
game.Lighting.TimeOfDay = 14
game.Lighting.Brightness = 0
model:remove()
Human.PlatformStand = false
Torso.Anchored = false
Human.WalkSpeed = 16
wait(10)
disabled = false
end
function lul(mouse)
mouse.Icon = “http://www.roblox.com/asset/?id=41672909
mouse.Button1Down:connect(onButton1Down)
end
function explhit(drumstep)
for d,s in pairs (drumstep:children()) do
if s.className == “Humanoid” then
s:takeDamage(80)
end
end
end
function chargeup()
Welds1()
wait(0.4)
ChargeWelds()
wait(0.3)
StartCharge()
wait()
MidCharge()
wait(0.5)
EndCharge()
wait(0.4)
end
function EndCharge()
local p = Instance.new(“Part”,char)
p.Anchored = true
p.CanCollide = false
p.Transparency = 0
p.Reflectance = 0.3
p.formFactor = “Symmetric”
p.Size = Vector3.new(12, 12, 12)
p.TopSurface = “Smooth”
p.BottomSurface = “Smooth”
p.Name = “Sharingan”
p.Shape = “Ball”
p.CFrame = Torso.CFrame
p.BrickColor = BrickColor.new(“Institutional white”)
for i = 1,10 do
p.Size = p.Size - Vector3.new(3,3,3)
p.CFrame = Torso.CFrame
wait()
end
p:remove()
end
function MidCharge()
local wow = Instance.new(“Part”,workspace)
wow.Anchored = true
wow.CanCollide = false
wow.Reflectance = 0.32
wow.formFactor = “Custom”
wow.Size = Vector3.new(12,12,12)
wow.TopSurface = “Smooth”
wow.Transparency = 0.5
wow.BottomSurface = “Smooth”
wow.CFrame = Torso.CFrame * CFrame.new(0,0,0)
wow.BrickColor = BrickColor.new(“Cyan”)
local wow2 = Instance.new(“Part”,workspace)
wow2.Anchored = true
wow2.CanCollide = false
wow2.Reflectance = 0.32
wow2.formFactor = “Custom”
wow2.Size = Vector3.new(12,12,12)
wow2.TopSurface = “Smooth”
wow2.Transparency = 0.5
wow2.BottomSurface = “Smooth”
wow2.CFrame = Torso.CFrame * CFrame.new(0,0,0)
wow2.BrickColor = BrickColor.new(“Royal Purple”)
local wow11 = Instance.new(“Part”,workspace)
wow11.Anchored = true
wow11.CanCollide = false
wow11.Reflectance = 0.32
wow11.formFactor = “Custom”
wow11.Size = Vector3.new(12,12,12)
wow11.TopSurface = “Smooth”
wow11.Transparency = 0.5
wow11.BottomSurface = “Smooth”
wow11.CFrame = Torso.CFrame * CFrame.new(0,0,0)
wow11.BrickColor = BrickColor.new(“Hot pink”)
local wow4 = Instance.new(“Part”,workspace)
wow4.Anchored = true
wow4.CanCollide = false
wow4.Reflectance = 0.32
wow4.formFactor = “Custom”
wow4.Size = Vector3.new(12,12,12)
wow4.TopSurface = “Smooth”
wow4.Transparency = 0.5
wow4.BottomSurface = “Smooth”
wow4.CFrame = Torso.CFrame * CFrame.new(0,0,0)
wow4.BrickColor = BrickColor.new(“Really black”)
local Taco = Instance.new(“SelectionBox”,wow)
Taco.Visible = true
Taco.Color = BrickColor.new(“Really red”)
Taco.Adornee = Taco.Parent
local Tacoz = Taco:clone()
Tacoz.Parent = wow2
Tacoz.Color = BrickColor.new(“Really black”)
Tacoz.Adornee = Tacoz.Parent
local Taco5 = Tacoz:clone()
Taco5.Parent = wow4
Taco5.Adornee = Taco5.Parent
Taco5.Color = BrickColor.new(“Really red”)
local Tacosh = Tacoz:clone()
Tacosh.Parent = wow11
Tacosh.Adornee = Tacosh.Parent
Tacosh.Color = BrickColor.new(“Really black”)
for i = 1,20 do
wait()
wow11.CFrame = wow11.CFrame * CFrame.fromEulerAnglesXYZ(6,6,6)
wow4.CFrame = wow4.CFrame * CFrame.fromEulerAnglesXYZ(-6,-6,-6)
wow2.CFrame = wow2.CFrame * CFrame.fromEulerAnglesXYZ(-3,2,6)
wow.CFrame = wow.CFrame * CFrame.fromEulerAnglesXYZ(5,1,-6)
end
wow:remove()
wow2:remove()
wow4:remove()
wow11:remove()
end
function StartCharge()
local p = Instance.new(“Part”,char)
p.Anchored = true
p.CanCollide = false
p.Transparency = 0.6
p.Reflectance = 0.3
p.formFactor = “Symmetric”
p.Size = Vector3.new(3,3,3)
p.TopSurface = “Smooth”
p.BottomSurface = “Smooth”
p.Name = “Sharingan”
p.Shape = “Ball”
p.CFrame = Torso.CFrame
p.BrickColor = BrickColor.new(“Institutional white”)
local O = Instance.new(“Part”,model)
O.Anchored = true
O.CanCollide = false
O.Transparency = 0
O.Reflectance = 0.3
O.formFactor = “Symmetric”
O.Size = Vector3.new(0, 0, 0)
O.TopSurface = “Smooth”
O.BottomSurface = “Smooth”
O.Name = “Sharingan”
O.Shape = “Ball”
O.CFrame = Torso.CFrame
O.BrickColor = BrickColor.new(“Cyan”)
local Mesh = Instance.new(“SpecialMesh”)
Mesh.Parent = O
Mesh.MeshType = “FileMesh”
Mesh.Scale = Vector3.new(1.3, 1.3, 1.3)
Mesh.MeshId = “http://www.roblox.com/asset/?id=3270017
Mesh.TextureId = “”
for i = 1,10 do
p.Size = p.Size + Vector3.new(3,3,3)
p.CFrame = Torso.CFrame
p.Transparency = p.Transparency + 0.1
O.Transparency = O.Transparency + 0.1
Mesh.Scale = Mesh.Scale + Vector3.new(4, 4, 4)
wait()
end
p:remove()
O:remove()
end
function onTouched(Taco)
if Taco.Parent.Name ~= pwn.Name and Taco.Parent.Parent.Name ~= pwn.Name then
if Taco.Parent.className == “Model” or Taco.Parent.Parent.className == “Model” then
for k,f in pairs(Taco.Parent:children()) do
if f.className == “Part” then
f.Anchored = false
coroutine.resume(coroutine.create(function()
f.Velocity = (Head.Position - f.Position).unit * -150
wait(0.4)
f.Veclovity = Vector3.new(0,0,0)
end))
elseif f.className == “ForceField” then
f:remove()
elseif f.className == “Hat” then
f:remove()
end
end
end
end
end
function shock()
local wowz = Instance.new(“Part”,workspace)
wowz.Anchored = true
wowz.CanCollide = false
wowz.Reflectance = 0.32
wowz.formFactor = “Custom”
wowz.Size = Vector3.new(0.2,0.2,0.2)
wowz.TopSurface = “Smooth”
wowz.Transparency = 0
wowz.BottomSurface = “Smooth”
wowz.CFrame = Torso.CFrame * CFrame.new(0,0,0)
wowz.BrickColor = BrickColor.new(“Really black”)
local Mesh2 = Instance.new(“SpecialMesh”,wow)
Mesh2.MeshType = “FileMesh”
Mesh2.Scale = Vector3.new(6,0.5,6)
Mesh2.MeshId = “http://www.roblox.com/asset/?id=20329976
Mesh2.TextureId = “”
for i = 1,30 do
wowz.CFrame = Torso.CFrame * CFrame.new(0,-2.5,0)
wait()
wowz.CFrame = wow.CFrame * CFrame.fromEulerAnglesXYZ(0,6,0)
wowz.BrickColor = BrickColor.Random()
end
wowz:remove()
end
function spinmesh()
local wowz = Instance.new(“Part”,char)
wowz.Anchored = true
wowz.CanCollide = false
wowz.Reflectance = 0.32
wowz.Shape = “Ball”
wowz.Transparency = 0
wowz.formFactor = “Custom”
wowz.Size = Vector3.new(9,9,9)
wowz.TopSurface = “Smooth”
wowz.BottomSurface = “Smooth”
wowz.CFrame = Torso.CFrame
wowz.BrickColor = BrickColor.new(“Really black”)
wait(3)
wowz:remove()
end
meshInsertion = coroutine.create(spinmesh)
core = coroutine.create(shock)
Tewl.Name = Nim
Tewl.Selected:connect(lul)
elseif k==“o” then
InputService.MouseBehavior = Enum.MouseBehavior.Default
elseif k==“p” then
InputService.MouseBehavior = Enum.MouseBehavior.LockCenter
elseif k==“n” then

– Originally made by Alfederate :smiley:

– there’s no time to explain! –

local new=Instance.new
local rad=math.rad
local cf=CFrame.new
local v3=Vector3.new
local ang=function(x,y,z)
return CFrame.Angles(rad(x),rad(y),rad(z))
end
local player=game:service’Players’.LocalPlayer
local char=player.Character
local cam=workspace.Camera
local mouse=player:GetMouse()
local weld=function(a,b,c0,c1)
m=Instance.new(‘Motor’,a)
m.Part0=a
m.Part1=b
m.C0=c0
m.C1=c1
return m
end

start=‘rbxassetid://592555095’
snd=‘rbxassetid://594472043’
beamm=Instance.new(‘Model’,workspace)
beamm.Name=‘beam’

laser=false

rs=Instance.new(‘Part’,char)
rs.Transparency=1
rs.CanCollide=false
rs.TopSurface,rs.BottomSurface=0,0
rs.FormFactor=3
rs.Size=Vector3.new(.5,.5,.5)

ls=rs:Clone()
ls.Parent=char

rsw=weld(rs,char.Torso,cf(-1,-.5,0),cf())
lsw=weld(ls,char.Torso,cf(1,-.5,0),cf())
raw=weld(char[‘Right Arm’],rs,cf(-.5,.6,-.14),ang(90,0,-8))
law=weld(char[‘Left Arm’],ls,cf(-.3,1.5,-.14),ang(90,0,43))

vol=1

s1=Instance.new(‘Sound’,char)
s1.Volume=vol
s1.Pitch=1
s1.Looped=true
s1.SoundId=snd

s2=Instance.new(‘Sound’,char)
s2.Volume=vol
s2.Pitch=1
s2.Looped=true
s2.SoundId=start

s2:play()

particles={}

local wep=new(‘Part’,char)
wep.FormFactor=3
wep.CanCollide=false
wep.Size=v3(1,3,1)
wep.TopSurface,wep.BottomSurface=0,0
local wepw=weld(wep,char[‘Right Arm’],cf(.26,.4,.7),ang(0,0,8))

local beam=wep:Clone()
beam:ClearAllChildren()
beam.Material=‘Neon’
beam.BrickColor=BrickColor.new(‘Electric blue’)
beam.Size=Vector3.new(3,3,1)
beam.Transparency=.5
beam.Anchored=true
local ms=Instance.new(‘BlockMesh’,beam)
local inner=beam:Clone()
inner.Transparency=0
inner.Material=‘SmoothPlastic’
inner.BrickColor=BrickColor.new(‘Green’)
local ms2=inner.Mesh

local expl=inner:Clone()
expl.Mesh:Destroy()
expl.Material=‘Neon’
expl.BrickColor=BrickColor.new(‘Really red’)
expl.Size=Vector3.new(11,11,11)
expl.Transparency=.55
pl=Instance.new(‘PointLight’,expl)
pl.Color=expl.BrickColor.Color
pl.Range=pl.Range*2
pl.Name=‘light’
local br=pl.Range

local exa=expl:Clone()
exa.Size=Vector3.new(4,4,4)
pl2=exa.light

local part=exa:Clone()
part.Size=Vector3.new(1.5,1.5,1.5)
pl3=part.light
pms=Instance.new(‘BlockMesh’,part)

char.Humanoid.Died:connect(function()
laser=false
beam.Parent=nil
inner.Parent=nil
expl.Parent=nil
exa.Parent=nil
s2:stop()
s1:stop()
end)

mouse.Button1Down:connect(function() if char.Humanoid.Health~=0 then
laser=true
s1:play()
s2:stop()
end end)
mouse.Button1Up:connect(function()
laser=false
beam.Parent=nil
inner.Parent=nil
expl.Parent=nil
exa.Parent=nil
s1:stop()
s2:play()
end)

parti=0
game:service’RunService’.Stepped:connect(function()
parti=parti+1
for i,v in pairs(particles) do
v.CFrame=v.CFrameCFrame.new(0,0,-.3)
v.Transparency=v.Transparency+.08
if v.Transparency >= 1 then
v:Destroy()
table.remove(particles,i)
else
v.Parent=beamm
end
end
a=cam.CoordinateFrame.p
b=mouse.Hit.p
mhitr=Ray.new(a,(b-a).unit
999)
mhit,ps=workspace:FindPartOnRayWithIgnoreList(mhitr,{char,beamm})
raw.C1=ang(90+(mouse.Hit.lookVector.y90),0,-8)
law.C1=ang(90+(mouse.Hit.lookVector.y
90),0,43)
if not char.Humanoid.Sit and not char.Humanoid.PlatformStand then
char.Torso.CFrame=CFrame.new(char.Torso.CFrame.p,Vector3.new(ps.x,char.Torso.CFrame.p.y,ps.z))
end
if laser then
beamm.Parent=workspace
beam.Parent=beamm
inner.Parent=beamm
expl.Parent=beamm
exa.Parent=beamm
s1.Volume=s1.Volume-.0

ray=Ray.new((wep.CFramecf(0,-1.5,0)).p,((wep.CFramecf(0,-10,0)).p-(wep.CFramecf(0,-1.5,0)).p).unit999)
hit,pos=workspace:FindPartOnRayWithIgnoreList(ray,{char,beamm})

if hit and hit.Parent:findFirstChild(‘Humanoid’) and s1.Volume > .3 and parti/8==math.floor(parti/8) then
Instance.new(‘Explosion’,workspace).Position=pos
end
if hit and hit.Parent==workspace.Terrain or hit==workspace.Terrain and parti/8==math.floor(parti/8) then
e=Instance.new(‘Explosion’,workspace)
e.Position=pos
e.BlastRadius=14
e.BlastPressure=1e4
end
if hit and not hit.Anchored and not (hit:GetMass()>1e4) then
hit.Velocity=hit.Velocity+beam.CFrame.lookVector*(1s1.Volumehit:GetMass())
end

if parti==math.floor(parti) then
par=part:Clone()
table.insert(particles,par)
par.Parent=beamm
par.Transparency=1-s1.Volume
par.light.Range=br*s1.Volume
par.CFrame=cf(pos)*ang(math.random(-180,180),math.random(-180,180),math.random(-180,180))*cf(0,0,-10)
end

mag=((wep.CFramecf(0,-1.5,0)).p-pos).magnitude
ms.Scale=v3(s1.Volume,s1.Volume,mag)
ms2.Scale=v3(ms.Scale.x/2,ms.Scale.y/2,mag-(.1/mag))
beam.CFrame=cf((wep.CFrame
cf(0,-1.5,0)).p,pos)cf(0,0,-mag/2)ang(0,0,math.random(0,180))
inner.CFrame=beam.CFrame
pl.Range=br
s1.Volume
pl2.Range=br
s1.Volume
expl.Size=v3(math.random(9,13),math.random(9,13),math.random(9,13))*s1.Volume
expl.Transparency=math.random(40,60)/100
expl.CFrame=cf(pos)ang(math.random(0,180),math.random(0,180),math.random(0,180))
exa.Size=v3(4,4,4)s1.Volume
exa.CFrame=wep.CFrame
cf(0,-1.5,0)ang(math.random(0,180),math.random(0,180),math.random(0,180))
char.Torso.Velocity=char.Torso.Velocity-beam.CFrame.lookVector
(7
s1.Volume)
end
end)
end
end)

InputService.InputChanged:connect(MouseMoved)

Neck.C1=cf()

local _
local DirectionBound=3.14159/3
local CurrentAngY=0

local function CameraUpdate()
Camera.CameraType=“Scriptable”
local cx,cz=CameraDirection.x,CameraDirection.z
local rvx,rvz=RootPart.Velocity.x,RootPart.Velocity.z
if rvxrvx+rvzrvz>4 and cxrvx+czrvz<-0.5*(cxcx+czcz)^0.5*(rvxrvx+rvzrvz)^0.5 then
DirectionBound=math.min(DirectionBound0.9,math.abs(CurrentAngY0.9))
else
DirectionBound=DirectionBound0.1+3.14159/30.9
end
local AngX,AngY=EulerAnglesYX((RootPart.CFrame-RootPart.Position):inverse()CameraDirection)
if AngY>DirectionBound then
RootPart.CFrame=RootPart.CFrame
CFrame.Angles(0,AngY-DirectionBound,0)
elseif AngY<-DirectionBound then
RootPart.CFrame=RootPart.CFrameCFrame.Angles(0,AngY+DirectionBound,0)
end
_,CurrentAngY=EulerAnglesYX((RootPart.CFrame-RootPart.Position):inverse()CameraDirection)
local CameraOrientation=AxisAngleLookNew((RootPart.CFrame-RootPart.Position):inverse()CameraDirection,1)
Neck.C0=CFrame.new(0,1,0)CameraOrientationCFrame.new(0,0.5,0)
local PreCam=AxisAngleLook(RootPart.CFrame
cf(0,1,0),RootPart.CFrame
v3(0,1,0)+CameraDirection)CFrame.new(0,0.825,0)
if Zoom== 3 then
local Part,Position=Workspace:findPartOnRay(Ray.new(PreCam.p,PreCam.lookVector
-8),Character)
Camera.CoordinateFrame=PreCam
CFrame.new(0,0,(Position-PreCam.p).magnitude)
else
Camera.CoordinateFrame=PreCam*CFrame.new(0,0,Zoom)
end
end

game:GetService(“RunService”).RenderStepped:connect(CameraUpdate)

I may not understand your question ,but “to die on touch”? Do you mean that you want your player to die when it’s touched by some enemy? I will use onTriggerEnter() and set the curHealth to 0.

Also

if(curHealth > 0)
Destroy(Player); //Doesn’t make sense to me because if it has any health it will die,even if it has 100 so of course it doesn’t work

 private void OnTriggerExit(Collider other)
    {
if(other.CompareTag("Enemy"))
curHp=0;//or Destroy(player);


}

function Update()
{
// if the player is dead destroy him
if(curHealth <= 0)
Destroy(gameObject);
// if curHelath < 0 → curHealth = 0; if curHealth > 100 → curHealth = 100
curHealth = Mathf.Clamp(curHealth,0,100);
}