Hi! so im trying to clone a script into a player when they touch a part, but when it clones, it parents two of them into the player. How would I fix this?
local hitbox = script.Parent
local players = game:GetService("Players")
local callrotate = game.ReplicatedStorage.Remotes.CallRotate
local lbremote = game.ReplicatedStorage.Remotes.Lightsaber
local getplayerbh = game.ReplicatedStorage.Remotes.Getplayeybh
local debounce = false
while task.wait(0.1) do
local touching = game.Workspace:GetPartsInPart(hitbox)
for i, v in pairs(touching) do
if v.Parent:FindFirstChild("Humanoid") ~= nil and not v.Parent:FindFirstChild("BlackHoleRotate") and game.Players:GetPlayerFromCharacter(v.Parent).galaxyimmune.galaxyimmune.Value == 0 then
print("is touching")
local blackholescript = game.ReplicatedStorage.Scripts.BlackHoleRotate:Clone()
blackholescript.Parent = v.Parent
callrotate:FireClient(game.Players:GetPlayerFromCharacter(v.Parent))
getplayerbh.OnServerEvent:Connect(function(player)
if debounce == false then
local killlb = game.ServerStorage.DebuffScripts.KillLB:Clone()
debounce = true
killlb.Parent = v.Parent
lbremote:FireClient()
end
end)
v.Parent.Humanoid.Health -= 5
task.wait(1)
v.Parent.Humanoid.Health -= 5
task.wait(1)
v.Parent.Humanoid.Health -= 5
task.wait(1)
v.Parent.Humanoid.Health -= 5
end
end
end