You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
-
What is the issue? Include screenshots / videos if possible!
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- This is an example Lua code block
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
I want any target that is dealt damage to also get knocked back a few studs. This is my script:
damageevent1.OnServerEvent:Connect(function(player, v)
v.Parent:FindFirstChild("Humanoid"):TakeDamage(10)
v.Parent.Position = v.Parent + Vector3.new(10,0,0)
end)
and the context for that script:
for i, v in pairs(workspace:GetPartsInPart(x)) do
if v.Parent:FindFirstChild("Humanoid") and v.Parent ~= Character and v.Parent:FindFirstChild("Hit"..Player.Name) == nil then
local x = Instance.new("IntValue", v.Parent)
x.Name = "Hit"..Player.Name
game.Debris:AddItem(x, 1)
damageevent1:FireServer(v)
end
end
I would also like the direction of the knockback to change depending on what direction the player hits the target.
Please help!