So, I have made some kind of heal thing, it's supposed to heal but it doesn't work, but the heal won't heal you.
This is what I made.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage:WaitForChild("HealEvent")
local debounce = true
RemoteEvent.OnServerEvent:Connect(function(player)
if debounce == true then
debounce = false
local char = player.Character
local part = game.ServerStorage.Heal:Clone()
part.Parent = workspace
part:SetPrimaryPartCFrame(char.Torso.CFrame)
part.Part2.CFrame = char.Torso.CFrame
part.Part.CFrame = char.Torso.CFrame
while true do
char.Humanoid.Health = char.Humanoid.Health + 10
if char.Humanoid.Health == char.Humanoid.MaxHealth then
break
end
end
wait(5)
if part then
part:Destroy()
end
wait(0.5)
debounce = true
end
end)
Thanks if you solved it.
