#help with getting markerreached on server from anim playing on client

1 messages · Page 1 of 1 (latest)

vital drum
#

im playing an animation on the client for a tool, but im handling everything else on server
if i wanna use GetMarkerReachedSignal on the server, how would i go about doing that?
i tried using a remotefunction to send from to server to client to play the animation then return the animation from client to server but it says the anim is nil on server

#

on client:

#

remotefunction setup didnt work so im just wondering what i should do now

wet osprey
#

just catch the event on the client and make it send a remote event to the server to do whatever you want

vital drum
# wet osprey just catch the event on the client and make it send a remote event to the server...

the issue is
im making a weapon and most stuff is handled on server
so to play an animation i send a remoteevent from server to client to play the animation but i cant really do getmarkerreachedsignal that way unless i make it check the animation on client but i dont wanna just have a bunch of elseifs on client that fire back to server
if having a bunch of elseifs is the only way to do it then ig ill do that but i feel like theres a more convenient way to go about this

#

??????????

#

why are you asking that here

wet osprey
#

why are you asking this in someone elses ticket 😭😭😭😭

#

LMAOO

vital drum
#

LOL

dire sand
wet osprey
#

no bro

dire sand
#

mb bro

wet osprey
vital drum
#

i see

#

ill wait to see if anyone else responds and if not ill have to bite the bullet and just do a bunch of checks

#

thanks for the help nonetheless

#

it would but

#

theres gonna be like

#

a ton of different anims

#

LOL WHAT WAS THAT

wet osprey
#

uhhhhhh

maiden cosmosBOT
#

studio** You are now Level 5! **studio

wet osprey
#

disregard that

#

🫃

wet osprey
#

!!!

vital drum
# vital drum a ton of different anims

so i dont wanna have a bunch of checks for which anim is playing like

if anim = "Tyrant Revolver" then
elseif anim = "Slam" then
etc etc
end

but if thats my only option ill just have to do it

wet osprey
#

you dont need checks

#

the animation event is seen across all client scripts

#

you dont need to check if the animation is playing

#

if the event fires then it will be recieved in the getmarkerreached

vital drum
#

im not checking if its playing i need to check the specific animation

#

since ill be sending different ones through

wet osprey
#

🤨

vital drum
#

if i just put general stuff for every animation through it would check for markers that dont exist
like right now im just checking for the Knee marker for an anim called TyrantRevolver, but what if i send a different animation to client which doesnt have a knee marker

lapis furnace
vital drum
wet osprey
#

your animation setup is just unique, maybe roblox studio guru come here and know what you're talking about

vital drum
#

ig

wet osprey
#

generally speaking you should be playing animations on the client, unless you have some specific framework where you dont want that

vital drum
#

ya i am playing anims on the client thats why this entire problem is happening lol

wet osprey
#

bro

vital drum
#

i fire something from server to signal to client to play the anim

wet osprey
#

right..

#

so then you just need to check for getmarkerreached and the specific event name

#

you dont need else ifs

#

you dont need to check what animation is playing

#

😭

vital drum
#

thats the problem im sending multiple different animations through the event

wet osprey
#

am I crazy

vital drum
#

not just a single one

wet osprey
#

ohh

#

so you have multiple animations with the same event name, but you want each animation to do different things?

#

if that's the case then yeah you would need to check which one is playing. but I would not recommend this, just use a different event name for each animation.

lapis furnace
#

my tip for you is handle animations clientsidedly (bonus: they have no replication delay) and validate the marker event on the server (exploiters can spoof remote events on the client)

example scripts (off of dev forum):


-- local script insideof a tool
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local tool = script.Parent
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://YOUR_ANIMATION_ID"
local animationTrack
tool.Activated:Connect(function()
    local character = player.Character
    if not character then return end
    local humanoid = character:FindFirstChildOfClass("Humanoid")
    if not humanoid then return end
    animationTrack = humanoid:LoadAnimation(animation)
    animationTrack:Play()
animationTrack:GetMarkerReachedSignal("YourMarkerName"):Connect(function(param)
game.ReplicatedStorage.AnimationMarkerFired:FireServer("YourMarkerName", param)
    end)
end)

-- serversided script to handle the marker 
game.ReplicatedStorage.AnimationMarkerFired.OnServerEvent:Connect(function(player, markerName, param)
    if markerName == "YourMarkerName" then
        print(player.Name .. " reached animation marker: " .. markerName)
        -- do the logic here
    end
end)
vital drum
maiden cosmosBOT
#

studio** You are now Level 10! **studio

wet osprey
#

yeah idk 🐧

vital drum
# lapis furnace my tip for you is handle animations clientsidedly (bonus: they have no replicati...

issue is with my setup i cant just do everything on client
the main attacks are on server and stuff so to play the animations i send a remoteevent from server to client which makes the animation play on client
theres only 1 remoteevent, and im sending different animations through it
so is there a way to detect the markerreached on server since i know the specific animation on server? or will i just have to put a bunch of checks to see which animation was sent to client and do getmarkerreachedsignal accordingly

wet osprey
#

I dont know about your problem specifically but your setup overall doesnt seem ideal. you want attacks to take place on the client, but then verify the attacks on the server

#

handling attacks on the server and sending animations via remote event will not feel responsive

#

there is a noticable delay

vital drum
lapis furnace
lapis furnace
#

the server can’t verify the client and even if it did it would pose security risks because of exploiters

vital drum
#

alright ill just have to do checks then