The touched event in my explosion is not working?
Asked by
2 years ago Edited 2 years ago
If you press "T" ( ik the method is deprecated ), it spawns a red ball; if another dummy or player touches it, it spawns a big black explosion where the red ball used to be the red ball gets destroyed. Everything that touches the explosion except your own character model just gets destroyed. the problem is that the other dummies don't die.
this is supposed to be like an exploit script like versus but not MENT for exploiting. its just a fun test
apologies for the broken lines in the end and apologies for how long it is
EDIT: i accidently made the dummies root part anchored
still I appreciate if u guys could find a way to destroy the dummies, even if the root part was anchored
04 | tweensrv = game:GetService( "TweenService" ) |
06 | Player = game:GetService( "Players" ).LocalPlayer |
07 | Character = Player.Character or Player.CharacterAdded:Wait() |
08 | Character.Humanoid.Name = "Monster" |
09 | hum = Character:FindFirstChildOfClass( "Humanoid" ) |
11 | mouse = Player:GetMouse() |
13 | hum.MaxHealth = math.huge |
17 | local theme = Instance.new( "Sound" ) |
21 | theme.RollOffMode = Enum.RollOffMode.Linear |
22 | theme.RollOffMinDistance = 10000 |
23 | theme.RollOffMaxDistance = 1000000 |
25 | theme.Parent = Character.Torso |
28 | LeftArm = Character [ "Left Arm" ] |
29 | LeftLeg = Character [ "Left Leg" ] |
30 | RightArm = Character [ "Right Arm" ] |
31 | RightLeg = Character [ "Right Leg" ] |
32 | Root = Character [ "HumanoidRootPart" ] |
34 | Torso = Character [ "Torso" ] |
37 | mouse.KeyDown:Connect( function (key) |
39 | local killbrick = Instance.new( "Part" ) |
40 | killbrick.Parent = workspace |
41 | killbrick.BrickColor = BrickColor.Red() |
42 | killbrick.CFrame = mouse.Hit |
43 | killbrick.Size = Vector 3. new( 5 , 5 , 5 ) |
44 | killbrick.Material = Enum.Material.Neon |
45 | killbrick.Anchored = true |
46 | killbrick.Shape = Enum.PartType.Ball |
48 | killbrick.Touched:Connect( function (other) |
49 | local Humanoid = other.Parent:FindFirstChildOfClass( "Humanoid" ) |
50 | if other.Parent ~ = Character and Humanoid then |
53 | local BallEffect = Instance.new( "Part" ) |
54 | BallEffect.CFrame = killbrick.CFrame |
55 | BallEffect.Size = Vector 3. new( 5 , 5 , 5 ) |
56 | BallEffect.Parent = workspace |
57 | BallEffect.Shape = Enum.PartType.Ball |
58 | BallEffect.BrickColor = BrickColor.Black() |
59 | BallEffect.Material = Enum.Material.Neon |
60 | BallEffect.Anchored = true |
61 | BallEffect.CanCollide = true |
62 | BallEffect.CastShadow = false |
63 | other.Parent:Destroy() |
65 | BallEffect.Touched:Connect( function (other 2 ) |
66 | local humanoid 2 = other 2. Parent:FindFirstChildOfClass( "Humanoid" ) |
68 | if other 2. Parent ~ = Character and humanoid 2 then |
70 | other 2. Parent:Destroy() |
74 | local GrowTween = tweensrv:Create(BallEffect, TweenInfo.new( 6 ), { Size = Vector 3. new( 500 , 500 , 500 ) } ) |
75 | local FadeTween = tweensrv:Create(BallEffect, TweenInfo.new( 1 ), { Transparency = 1 } ) |
81 | FadeTween.Completed:Wait() |
please help me fix this