Hello roblox developers!
INTRODUCTON
I’m creating a game called “Streak Simulator” in which your kills are numbered to make you stronger.
PROBLEM
For the final phase, the ability is to kill people on a specific hitbox per second.
I have a part called “StreakPhase7Hitbox” and a folder called “UnaffectedItems” and I added this folder so that players can’t punch the hitbox part w/ the player. My code ABSOLUTELY ignores my clone code for the hitbox. When it runs, I get an error stating that the hitbox is not a valid member of the folder.
Code (Server Script):
game.ReplicatedStorage.StreakPhase7.OnServerEvent:Connect(function(plr, player)
player.PlayerGui.PressEStreakPhase6:Destroy()
player.PlayerGui.MobileStreak6:Destroy()
local NewFolder = Instance.new("Folder")
NewFolder.Parent = player.Character
NewFolder.Name = "UnaffectedItems"
local SP7H = game.ServerStorage.StreakPhase7Hitbox:Clone() <- This it where it ignores the codes.
SP7H.Parent = player.Character.UnaffectedItems <- This it where it ignores the codes.
SP7H.Safe.Value = player.Name <- This it where it ignores the codes.
player.PlayerGui.PressEStreakPhase7.Enabled = true
player.PlayerGui.MobileStreak7.Enabled = true
for i, v in pairs(player.Character:GetDescendants()) do
if v.ClassName == "ParticleEmitter" or v.Name == "Powerful" then
v:Destroy()
end
end
local SP6 = player.Character.Head.StreakPhase6
SP6:Destroy()
local char = player.Character
player.Values.StreakPhase6.Value = false
player.Values.StreakPhase7.Value = true
player.Values.AbleToPunch.Value = true
player.Values.PowerAbility.Value += 2500
player.Character.Animate:Destroy()
game.ReplicatedStorage.AnimationFinal:Clone().Parent = player.Character
player.Character.Humanoid.WalkSpeed = 25
player.Values.Walkspeed.Value -= 60
local DetailNoS = game.ReplicatedStorage.DetailPhase7Streak:Clone()
DetailNoS.Parent = player.Character.HumanoidRootPart
for i, v in pairs(DetailNoS:GetChildren()) do
v.Parent = player.Character.HumanoidRootPart
local newV = v:Clone()
newV.Parent = player.Character.Head
local newV2 = v:Clone()
newV2.Parent = player.Character["Left Arm"]
local newV3 = v:Clone()
newV3.Parent = player.Character["Left Leg"]
local newV4 = v:Clone()
newV4.Parent = player.Character["Right Arm"]
local newV5 = v:Clone()
newV5.Parent = player.Character["Right Leg"]
local newV6 = v:Clone()
newV6.Parent = player.Character.Torso
end
DetailNoS:Destroy()
wait(3)
local SP7 = workspace.StreakPhase7:Clone()
SP7.Parent = player.Character.Head
SP7:Play()
wait(18.83)
game.Workspace.ValuesServer.FOVGui.Value = true
local Transformation1 = game.ReplicatedStorage.TransformationCompleteShock:Clone()
Transformation1.Parent = player.Character.HumanoidRootPart
for i, v in pairs(Transformation1:GetChildren()) do
v.Parent = player.Character.HumanoidRootPart
end
Transformation1:Destroy()
local Transformation2 = game.ReplicatedStorage.TransformationCompleteShock:Clone()
Transformation2.Parent = player.Character.Head
for i, v in pairs(Transformation2:GetChildren()) do
v.Parent = player.Character.Head
end
Transformation2:Destroy()
local Transformation3 = game.ReplicatedStorage.TransformationCompleteShock:Clone()
Transformation3.Parent = player.Character["Left Arm"]
for i, v in pairs(Transformation3:GetChildren()) do
v.Parent = player.Character["Left Arm"]
end
Transformation3:Destroy()
local Transformation4 = game.ReplicatedStorage.TransformationCompleteShock:Clone()
Transformation4.Parent = player.Character["Left Leg"]
for i, v in pairs(Transformation4:GetChildren()) do
v.Parent = player.Character["Left Leg"]
end
Transformation4:Destroy()
local Transformation5 = game.ReplicatedStorage.TransformationCompleteShock:Clone()
Transformation5.Parent = player.Character["Right Arm"]
for i, v in pairs(Transformation5:GetChildren()) do
v.Parent = player.Character["Right Arm"]
end
Transformation5:Destroy()
local Transformation6 = game.ReplicatedStorage.TransformationCompleteShock:Clone()
Transformation6.Parent = player.Character["Right Leg"]
for i, v in pairs(Transformation6:GetChildren()) do
v.Parent = player.Character["Right Leg"]
end
Transformation6:Destroy()
local Transformation7 = game.ReplicatedStorage.TransformationCompleteShock:Clone()
Transformation7.Parent = player.Character.Torso
for i, v in pairs(Transformation7:GetChildren()) do
v.Parent = player.Character.Torso
end
Transformation7:Destroy()
workspace.ValuesServer.TransformPhase7StreakGui.Value = true
game.ReplicatedStorage.FinalPhaseEffectShock:Fire(player)
wait(2)
workspace.ValuesServer.FOVGui.Value = false
workspace.ValuesServer.TransformPhase7StreakGui.Value = false
end)
game.ReplicatedStorage.StreakPhase7Ability.OnServerEvent:Connect(function(plr, player)
player.PlayerGui.AbilityGUI.Enabled = true
player.Character:WaitForChild("UnaffectedItems").StreakPhase7Hitbox.ShockScript.Disabled = false <- This it where it errors.
player.PlayerGui.AbilityGUI.AbilityMain.AbilityCount.Text = "1"
wait(1)
player.PlayerGui.AbilityGUI.Enabled = false
player.Character:WaitForChild("UnaffectedItems").StreakPhase7Hitbox.ShockScript.Disabled = true <- This it where it errors.
end)
Can you please help me? Thanks.