I noticed an error that pretty much renders the whole script pointless:
1 | cFF.Touched:Connect( function (hit) |
2 | if hit.Parent:FindFirstChild( "BlueOrb" ) then |
3 | workspace.BlueOrb:Destroy() |
"Touched" Is an event that is triggered only when a part collides into another, you should consider adding a ClickDetector inside cFF if you want the player to use the LeftMouseButton to destroy the part, and in that case the script would be
01 | local event = game.ReplicatedStorage.Events.ForcefieldEvent |
04 | event.OnServerEvent:Connect( function (player) |
05 | local Character = player.Character or player.CharacterAdded:wait() |
06 | local upperTorso = player.Character.UpperTorso |
07 | local weld = Instance.new( "WeldConstraint" ,upperTorso) |
08 | local cFF = Instance.new( "Part" ,workspace) |
09 | local click = Instance.new() |
11 | cFF.CanCollide = false |
12 | cFF.Size = Vector 3. new( 11.87 , 11.87 , 11.87 ) |
14 | cFF.Material = Enum.Material.SmoothPlastic |
15 | cFF.Position = upperTorso.Position |
17 | weld.Part 0 = upperTorso |
19 | cFF.Transparency = 0.5 |
20 | local debounce = false |
21 | click.MouseClick:Connect( function (hit) |
22 | if debounce = = false then |
24 | workspace:FindFirstChild( "BlueOrb" ) |
25 | workspace.BlueOrb:Destroy() |
Also sorry if this doesn't work as I didn't have the full script and couldn't test it out, if there are any problems please comment, hope this helps!