local UIS = game:GetService("UserInputService") UIS.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.F and Debounce6 == false then Debounce6 = true game.ReplicatedStorage.Astroids:FireServer(plr) wait(5) Debounce6 = false end end) -------------------NEW SCRIPT Passing throught remote event game.ReplicatedStorage.Astroids.OnServerEvent:Connect(function(Plr) --First Astroid if game.ReplicatedStorage.InGame.Value == true then local A1 = game.ReplicatedStorage.Astroid:Clone() A1.Anchored = false local Root = Plr.Character.HumanoidRootPart A1.CFrame = Root.CFrame + Vector3.new(-15,15,-30) A1.Parent = game.Workspace local debounce = false A1.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then if hit.Parent == Plr.Character then else if debounce == false then debounce = true hit.Parent:FindFirstChild("Humanoid").Health = hit.Parent:FindFirstChild("Humanoid").Health - 10 wait(0.75) debounce = false end end end end) --Second Astroid local A2 = game.ReplicatedStorage.Astroid:Clone() A2.Anchored = false local Root = Plr.Character.HumanoidRootPart A2.CFrame = Root.CFrame + Vector3.new(7,15,-15) A2.Parent = game.Workspace local Debounce2 = false A2.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then if hit.Parent == Plr.Character then else if Debounce2 == false then Debounce2 = true hit.Parent:FindFirstChild("Humanoid").Health = hit.Parent:FindFirstChild("Humanoid").Health - 10 wait(0.75) Debounce2 = false end end end end) ---Third astroid local A3 = game.ReplicatedStorage.Astroid:Clone() A3.Anchored = false local Root = Plr.Character.HumanoidRootPart A3.CFrame = Root.CFrame + Vector3.new(14,15,-10) A3.Parent = game.Workspace local Debounce3 = false A3.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then if hit.Parent == Plr.Character then else if Debounce3 == false then Debounce3 = true hit.Parent:FindFirstChild("Humanoid").Health = hit.Parent:FindFirstChild("Humanoid").Health - 10 wait(0.75) Debounce3 = false end end end end) ----Fourth Astriod local A4 = game.ReplicatedStorage.Astroid:Clone() A4.Anchored = false local Root = Plr.Character.HumanoidRootPart A4.CFrame = Root.CFrame + Vector3.new(4,8,-19) A4.Parent = game.Workspace local Debounce4 = false A4.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then if hit.Parent == Plr.Character then end else if Debounce4 == false then Debounce4 = true hit.Parent:FindFirstChild("Humanoid").Health = hit.Parent:FindFirstChild("Humanoid").Health - 10 wait(0.75) Debounce4 = false end end end) wait(1) --Deleting all of the astroids A1.Parent = game.Debris A2.Parent = game.Debris A3.Parent = game.Debris A4.Parent = game.Debris end end)