What I am trying to do?
What I have tried?
What I have tried script:
local DemonPart = script.Parent local db = false DemonPart.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then if db == false then db = true print(db) local hitplayer = hit.Parent local player = game.Players.LocalPlayer hitplayer.Humanoid.Health = 0 local demonbill = Instance.new("BillboardGui") demonbill.MaxDistance = 25 demonbill.StudsOffset = Vector3.new(0,1.3,0) demonbill.Name = "demonbill" demonbill.Active = true demonbill.Size = UDim2.new(.200, 0, .50, 0) demonbill.Parent = hit.Parent.Head local textlabel = Instance.new("TextLabel") textlabel.Text = "DEMON" textlabel.TextColor3 = Color3.new(255,0,0) textlabel.BackgroundTransparency = 1 textlabel.TextSize = 30 textlabel.Font = Enum.Font.GothamBold textlabel.Active = true textlabel.Size = UDim2.new(.200,0,.50,0) textlabel.Parent = demonbill while true do if hitplayer.Humanoid.Health == 0 then wait(5) local demonbill = Instance.new("BillboardGui") demonbill.MaxDistance = 25 demonbill.StudsOffset = Vector3.new(0,1.3,0) demonbill.Name = "demonbill" demonbill.Active = true demonbill.Size = UDim2.new(.200, 0, .50, 0) demonbill.Parent = hit.Parent.Head local textlabel = Instance.new("TextLabel") textlabel.Text = "DEMON" textlabel.TextColor3 = Color3.new(255,0,0) textlabel.BackgroundTransparency = 1 textlabel.TextSize = 30 textlabel.Font = Enum.Font.GothamBold textlabel.Active = true textlabel.Size = UDim2.new(.200,0,.50,0) textlabel.Parent = demonbill end end end end end)
What I did after it didn't work?
What is my script now?
local DemonPart = script.Parent local db = false DemonPart.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then if db == false then db = true print(db) local hitplayer = hit.Parent local player = game.Players.LocalPlayer hitplayer.Humanoid.Health = 0 local demonbill = Instance.new("BillboardGui") demonbill.MaxDistance = 25 demonbill.StudsOffset = Vector3.new(0,1.3,0) demonbill.Name = "demonbill" demonbill.Active = true demonbill.Size = UDim2.new(.200, 0, .50, 0) demonbill.Parent = hit.Parent.Head local textlabel = Instance.new("TextLabel") textlabel.Text = "DEMON" textlabel.TextColor3 = Color3.new(255,0,0) textlabel.BackgroundTransparency = 1 textlabel.TextSize = 30 textlabel.Font = Enum.Font.GothamBold textlabel.Active = true textlabel.Size = UDim2.new(.200,0,.50,0) textlabel.Parent = demonbill end end end)