I need help changing this to a normal script because when I press Q I only take damage and not others. I just want them to take damage.
wait(3)
UserInputService = game:GetService("UserInputService")
local players = game:GetService("Players")
local dash = script:WaitForChild("Dash")
local localPlayer = players.LocalPlayer
local tween = game:GetService("TweenService")
local humanoid = localPlayer.Character:WaitForChild("Humanoid")
local humRootPart = humanoid.Parent:WaitForChild("HumanoidRootPart")
local info1 = TweenInfo.new(
1.3,
Enum.EasingStyle.Quint,
Enum.EasingDirection.Out,
0,
false,
0
)
local info2 = TweenInfo.new(
0.1,
Enum.EasingStyle.Quint,
Enum.EasingDirection.Out,
0,
false,
0
)
local db = false
local db2 = false
local db3 = false
local makeTrail = function(A0, A1, Parent, Transparency, Lifetime)
local t = Instance.new("Trail", Parent)
t.Color = ColorSequence.new(Color3.new(255, 255, 255), Color3.new(255, 255, 255))
local a0 = Instance.new("Attachment", A0)
local a1 = Instance.new("Attachment", A1)
t.Attachment0 = a0
t.Attachment1 = a1
t.Transparency = NumberSequence.new(Transparency)
t.Lifetime = Lifetime
end
UserInputService.InputBegan:Connect(function(input, gameProccesedEvent)
if input.KeyCode == Enum.KeyCode.E and db == false then
db = true
local endPos = {
CFrame = humRootPart.CFrame:ToWorldSpace(CFrame.new(0, 0, -60))
}
local animation = humanoid:LoadAnimation(dash)
local move = tween:Create(humRootPart, info1, endPos)
animation:Play()
move:Play()
makeTrail(localPlayer.Character:FindFirstChild("RightUpperArm"), localPlayer.Character:FindFirstChild("RightHand"), localPlayer.Character, 0.7, 0.2)
makeTrail(localPlayer.Character:FindFirstChild("LeftUpperArm"), localPlayer.Character:FindFirstChild("LeftHand"), localPlayer.Character, 0.7, 0.2)
wait(0.5)
localPlayer.Character.RightUpperArm.Attachment:Destroy()
localPlayer.Character.LeftUpperArm.Attachment:Destroy()
localPlayer.Character.RightHand.Attachment:Destroy()
localPlayer.Character.LeftHand.Attachment:Destroy()
localPlayer.Character:FindFirstChild("Trail"):Destroy()
wait(0.5)
db = false
end
end)
UserInputService.InputBegan:Connect(function(input, gameProccesedEvent)
if input.KeyCode == Enum.KeyCode.Q and db2 == false then
db2 = true
local burst = humanoid:LoadAnimation(script:FindFirstChild("Dash"))
burst:Play()
local b = Instance.new("Part", game.Workspace)
b.Name = "Blast"
b.BrickColor = BrickColor.new("New Yeller")
b.Shape = Enum.PartType.Ball
b.TopSurface = Enum.SurfaceType.Smooth
b.BottomSurface = Enum.SurfaceType.Smooth
b.Anchored = true
b.CanCollide = false
b.Material = Enum.Material.Neon
b.Transparency = 0.7
for i = 1, 20, 2 do
b.Size = Vector3.new(i, i, i)
b.CFrame = humRootPart.CFrame
wait()
end
humanoid:TakeDamage(20)
b:Destroy()
wait(1)
db2 = false
end
end)

1 comment
You are taking damage of the humanoid of the local player, which will not do damage to other players, and if you want to convert this to a normal script that will not work because UIS only works for local scripts. Maybe try using remote events? When input begins and the keycode = Q then fire this remote event and take damage of everyone who is near