#the animation only plays for the client

1 messages · Page 1 of 1 (latest)

pale pasture
#

For some reason the custom tool hold animation only plays for the client and not everyone else in the sever, here's the script in the tool, does anyone know how I can fix this? 😭

#

local player = game.Players.LocalPlayer
local character = player.Character

local humanoid = character:WaitForChild("Humanoid")
local Animator = humanoid:FindFirstChild("Animator")

local Tool = script.Parent

local IdleAnim = script:FindFirstChild("Idle")
local IdleTrack = humanoid:LoadAnimation(IdleAnim)
local Tool = script.Parent

local Grip = Tool.Connectors.Grip

local Ui = game.ReplicatedStorage.ToolsUis:WaitForChild("PhoneGui")

Tool.Equipped:Connect(function()

local ScreenGui = Ui:Clone()
ScreenGui.Parent = game.Players.LocalPlayer.PlayerGui

IdleTrack:Play()
Grip.Part0 = Tool.Parent:WaitForChild("Right Arm")

end)

Tool.Unequipped:Connect(function()

IdleTrack:Stop()
Grip.Part0 = nil

end)

warm elm
#

So im assuming this is a local script

#

and If it is then only the player who runs the script will see it and nobody else will

hushed dock
#

if u play an animation from a local script

#

then only the client, which so the player itself sees it

#

u gotta play it from the server script

#

if u want everyone to see

fossil jewel
hushed dock
#

from what I know as a scripter

#

if u execute something from client

#

only the local player itself will see

#

or recieve it

clever flower
#

Animations are different

#

If u play them on the client

#

They will replicate to the server

#

U can test this by doing a server client test run

#

And playing an animation on the client

#

Also if u go into workspace during a test session and character model ull notice an animate local script

#

Proving it replicates

solar mist
#

yea thats true its why u see exploiters with custom animations since roblox automatically replicates it to other clients how did u check that the animation only plays for the client and not other clients?

pale pasture
pale pasture
pale pasture
pale pasture
lucid laurelBOT
#

studio** You are now Level 7! **studio

warm elm
pale pasture
pale pasture
#

this is the normal script if you want to know but I don't think it has anything to do with this issue

#

local Tool = script.Parent
local Grip = Tool.Connectors.Grip

script.Parent.Equipped:Connect(function()
Grip.Part0 = Tool.Parent:WaitForChild("Right Arm")
end)

Tool.Unequipped:Connect(function()

Grip.Part0 = nil

end)

warm elm
pale pasture
#

yeah

#

there were no issues from the client side of things from what I can tell

#

there are also no errors

warm elm
# pale pasture yeah

Well my only guess would be that the animations has some sort of ownership issues or smthing

pale pasture
#

it's impossible, lemmie explain

#

I gotta give more context tho

#

so, in my game you can equip tools and emote with them

#

this is the gui with the buttons that triggers the emotes

#

when you click on these it stops the hold animation and plays the emote

#

and for some reason when you stop using an emote from this menu, the line of code that makes the hold animation start again, it works for the other players and suddenly they can see the animation

#

but if you unequip the tool and equip it again the animation is broken again

#

if you want I can send the script for the local script that triggers an emote, maybe the solution is there?? 😭

#

Phone is equipped (it pops up but no animation)

#

emote plays after clicking the button

#

emote is stopped and now the hold animation is here

vestal agate
#

Is your animation uploaded as an Action?
As a last resort you can always play it on the server instead, but it isn't ideal

pale pasture
pale pasture
# pale pasture if you want I can send the script for the local script that triggers an emote, m...

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local tool = nil
while not tool do
tool = character:FindFirstChildWhichIsA("Tool")
task.wait()
end
local hum = character:WaitForChild("Humanoid")
local Emote = hum:LoadAnimation(script.Parent.Emote)
local frame = script.Parent.Parent
local talk = frame.Talking
local play = frame.Playing

local humanoid = character:WaitForChild("Humanoid")
local Tool = character:WaitForChild("Phone")
local Idle = Tool.holdanim.Idle
local Idleplay = hum:LoadAnimation(Idle)

playing = false

script.Parent.MouseButton1Click:Connect(function()

if playing == false then

    for i,v in character.Humanoid.Animator:GetPlayingAnimationTracks() do
        if v.Name == "Idle" then
            v:Stop()
        end
    end
    Emote:Play()
    talk.Visible = false
    play.Visible = false
    playing = true
elseif playing == true then
    Idleplay:Play()
    Emote:Stop()
    talk.Visible = true
    play.Visible = true
    playing = false
end

end)

tool.Unequipped:Connect(function()
Idleplay:Stop()
Emote:Stop()
talk.Visible = true
play.Visible = true
playing = false
task.wait()
script:FindFirstAncestorWhichIsA("ScreenGui"):Destroy()
end)

#

From what I see there's not much that's diffrent in how it finds and plays the animation in this script compared to the one inside the tool

tidal sun
pale pasture
#

it didn't do anything 😭

solar mist
#

so the problem is that the phone equipped animation doesnt play?

wintry viper
pale pasture
pale pasture
wintry viper
#

hmmm

pale pasture
solar mist
#

where do u store the viewing and equip animations?

solar mist
pale pasture
wintry viper
#

?

pale pasture
#

it's inside the local script

wintry viper
#

to play animations

pale pasture
pale pasture
solar mist
wintry viper
#

maybe the problem is here that's stopping all Idle named animations

solar mist
#

I think what might be happening is that ur idle animation works since its parented to ur local script but the equip is parented to ur screengui which might not exist. Also your "unequipping animation" just looks like the default holding gear animation.

wintry viper
#

but actually idk because is playing in the client

pale pasture
#

no, these are the emotes, this gui is stored in ReplicatedStorage and when the phone is equipped it gets sent to PlayerGui

pale pasture
wintry viper
#

if the animation is playing on the client it should be running to all players

solar mist
#

do u mind if I just join ur game rq and just see?

pale pasture
#

what is your user?

solar mist
#

I think that will just be easier

pale pasture
#

yeah

solar mist
#

Rowdy_Monkey

tight cedar
#

can anyonehelp me

solar mist
pale pasture
wintry viper
#

is the idle equip animation looped?

solar mist
#

thats the hold right?

pale pasture
#

yes

#

just a still non moving pose for the hand and the phone

solar mist
#

hmmm ok so u dont have any equip or unequip aniamtions

wintry viper
lucid laurelBOT
#

studio** You are now Level 4! **studio

solar mist
#

oh did u send invite for the game

pale pasture
#

I added you but we need to be added for you to edit

solar mist
#

oh ok

#

whats ur user?

pale pasture
#

boyngt6355

#

I sent a request

solar mist
#

aight got it

#

ill try join ur game and see rq

pale pasture
#

you should be able to now

solar mist
#

aighty can u invite

#

k

#

ok i see

#

which gear is it? the tablet right?

pale pasture
#

yup, the phone

solar mist
#

ok so the client is perfect right?

pale pasture
#

it's the one in serverstorage

#

yeah

solar mist
#

ok ill see how it looks for others now

pale pasture
#

there's no issues there

pale pasture
solar mist
#

man I hate the new stuido gui I gott afigure out how to run 2 players no brahhh

pale pasture
#

the book is the only one with animations so far

pale pasture
#

it's on the left, you can scroll on the test options

solar mist
#

yea I think I got it

#

ok yea I got two clients rn

#

okk I see so its just ur equipping animation that isnt replicating

#

ill just see if I can fix it now

pale pasture
#

thank you 😭

tight cedar
#

can anyone help me

pale pasture
#

I love working on studio but because of my huge lack of scripting abilities it's so unmotivating sometimes

pale pasture
solar mist
#

yea its tough when u start out

tight cedar
#

a realistic vr driving system

pale pasture
#

I know pretty much nothing about scripting so I can't help, sorry

tight cedar
#

ok

pale pasture
#

you should make a post asking for help with that

tight cedar
#

i dis

#

dis

#

did

pale pasture
#

if it was long ago maybe make a new one?

tight cedar
#

i just did it like 5 min ago

pale pasture
tight cedar
#

alr

pale pasture
solar mist
pale pasture
#

if you're up to reading a bit, here's the context behind the tool being build in a weird way

#

I found a tutorial and it worked, so I went with it

solar mist
#

hmmmm ngl this is cooking me hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm

pale pasture
#

I feel like my games are a curse

lucid laurelBOT
#

studio** You are now Level 8! **studio

pale pasture
#

these difficult to explain issues happen all the time to me 😔

solar mist
#

hmmmmmm the phone is replcating but not trhe animation...... ill keep looking its probs something simple

pale pasture
#

I swear it's gonna end up being 1 typo I made 😭

solar mist
#

OHHH I think I know what it could be

#

so ur texting animations work sinceyou have netwrok ownership over ur play

#

player*

#

but I think with ur tool there might be some problem there with who owns it

solar mist
#

ill keep looking further but im pretty sure that could be it

pale pasture
#

I can try reuploading the still frame?

#

maybe that'll fix it?

solar mist
#

what I mean is like who has control over it

pale pasture
#

I made it myself so it should be me

#

I made all the emotes too

solar mist
#

no I mean like when u have an unachored part the client usually has control over it

#

so the server doesnt have to the physics calculations for it

pale pasture
#

oh

solar mist
#

gimme 2 seconndsssss

#

ok finally fixed it lol

#

the problem was........you didnt have a handle for ur phone

#

thats it

pale pasture
#

omg 😭

solar mist
#

I just added a temp one there u can change it when u want

pale pasture
#

okay, thank you sooooo much!! 😭

#

😭

solar mist
#

no problem bro keep it u p