ive been trying to fix this bindable event to work is there a reason its not working, it did fire it
i rechecked the name of it im not sure why it doesnt work, it prints out “works” but not “fired”
local damageEvent = game:GetService(“ReplicatedStorage”).Events:WaitForChild(“DamageEvent”)
local lastslashEvent = game:GetService(“ReplicatedStorage”).Events.LastSlash
local blockingevent = game:GetService(“ReplicatedStorage”).Events.PlayerBlocking
local slasheffect = game.ReplicatedStorage.VFX.SwordVfx.Slash.Hit
local slashhit = game.ReplicatedStorage.VFX.SwordVfx.SwordSlash
local TweenService = game:GetService(“TweenService”)
local function moveBackward(humanoid)
local startPosition = humanoid.RootPart.Position
local endPosition = startPosition - humanoid.RootPart.CFrame.lookVector * 0.5
local tweenInfo = TweenInfo.new(0.4, Enum.EasingStyle.Quad)
local tween = TweenService:Create(humanoid.RootPart, tweenInfo, {Position = endPosition})
tween:Play()
Please format code it’s hard to read when it isn’t.
The problem could be in the code firing the event.
It could be a timing issue, has this definitely run before attempting to fire?
It could be a parenting issue, bindables will only run in the same context (server to server).
No. You need to use a remote event.
Works the same way but the commands are slightly different such as event.onServerEvent:Connect and event:FireServer. When firing from client it will also add a ‘player’ argument to the args, so you just need to remember if you’re sending multiple args.
You should be able to just swap it over and amend your listener connection to damageEvent.OnServerEvent:Connect(function(player, humanoid, damageAmount, humanoidAttacker)
And the firing one to damageEvent:FireServer(humanoid, damage amount,humanoid attacker)
(Sorry about any typos.)
So the problem is after each slash it runs the event and it fires for every player in the game example normally it does 5 damage on each event but if theres more players it will do more damage for the humanoid, example 2 players will be 10 damage 3 would be 15 and so on because it fires it for every player including the local player that is slashing.
Ah ok, I think it is because a new event connection is being created every time you run the function moveBackward.
If you put the eventlistener outside the function it should work as you wanted.
RemoteFunctions and RemoteEvents are to communicate between the client and server. If we’re talking about BindableEvents or BindableFunctions, then they would have the same authority as whichever (client or server) called it, same applies to Modules.