#the animation only plays for the client
1 messages · Page 1 of 1 (latest)
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)
Im still new to scripting so i could 100% be wrong but from my knowledge local scripts only interact with the client and cannot interact with the server
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
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
im pretty sure animatoons replicate to all players even if played from client
from what I know as a scripter
if u execute something from client
only the local player itself will see
or recieve it
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
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?
yeah it is
sorry if I sound dumb af, but the other local scripts that trigger tools animations do show up for other players so why do those scripts work and no this? It plays the anims the same way as this one
do you know how I can do that? I pasted the animation lines to a normal script and it didn't work, there was an error that said that "character" does not exist
but the animation that this script triggers does not play for other players? I'm lost 😭
** You are now Level 7! **
Im not really sure how well I can help you but where is the script located exactly
first I tried with the player simulation test thing and it didn't work and then I joined the game on my main and alt and it didn't work that way too
it's inside of the tool (don't mind the structure being a mess, I was following a tutorial. Someone told me that the tutorial was shit, but I'm too deep into this to restart 😭 )
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)
Is the animation valid like if you tried to get your alt account to run the animation could your alt account run and see the animation?
yeah
there were no issues from the client side of things from what I can tell
there are also no errors
Well my only guess would be that the animations has some sort of ownership issues or smthing
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
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
yeah it is uploaded as an Action
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
local hum = character:WaitForChild("Humanoid")
Maybe try playing it on the animator instead of humanoid?
okay, I'll try
it didn't do anything 😭
so the problem is that the phone equipped animation doesnt play?
the animation only plays for the client or is not playing?
yeah but only for others, for the player using the tool it actually plays
only for the client
hmmm
but it's this one that's broken
where do u store the viewing and equip animations?
since I would assume the viewing and equip animations would be right next to idle animation
the'res only one for holding the tool
have you tried using animator instead of humanoid
?
it's inside the local script
to play animations
yeah, it didn't change anything
if you mean the emotes, they are inside PlayerGui in the frame with the buttons
hmmmm is equip and unequipping considered emotes in ur system?
maybe the problem is here that's stopping all Idle named animations
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.
but actually idk because is playing in the client
no, these are the emotes, this gui is stored in ReplicatedStorage and when the phone is equipped it gets sent to PlayerGui
this script is not the problem that one is fine
if the animation is playing on the client it should be running to all players
I'm talking about this one
do u mind if I just join ur game rq and just see?
what is your user?
I think that will just be easier
yeah
Rowdy_Monkey
can anyonehelp me
2 seconds brochacho
also you missunderstood, there's no equip and unequip animation, there's only the hold one that is supposed to look like the default hold. I'm not really gonna explain why I made it that way, it's A LOT of context
is the idle equip animation looped?
so when ur viewing the screen whats that meant to be?
thats the hold right?
hmmm ok so u dont have any equip or unequip aniamtions
what you need?
** You are now Level 4! **
yeah
oh did u send invite for the game
I added you but we need to be added for you to edit
you should be able to now
yup, the phone
ok so the client is perfect right?
ok ill see how it looks for others now
there's no issues there
it's only the phone that has this so far
man I hate the new stuido gui I gott afigure out how to run 2 players no brahhh
the book is the only one with animations so far
yeah same it kinda sucks getting used to
it's on the left, you can scroll on the test options
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
thank you 😭
can anyone help me
I love working on studio but because of my huge lack of scripting abilities it's so unmotivating sometimes
with what?
yea its tough when u start out
a realistic vr driving system
oh 😨
I know pretty much nothing about scripting so I can't help, sorry
ok
you should make a post asking for help with that
if it was long ago maybe make a new one?
i just did it like 5 min ago
oh, you just gotta wait then and hope someone responds
alr
have you found out what's making this not work for the server?
almost im just tryna figure out where the equip logic is I think I found it
okay 😨
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
hmmmm ngl this is cooking me hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
I feel like my games are a curse
** You are now Level 8! **
these difficult to explain issues happen all the time to me 😔
hmmmmmm the phone is replcating but not trhe animation...... ill keep looking its probs something simple
I swear it's gonna end up being 1 typo I made 😭
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
ill keep looking further but im pretty sure that could be it
um 😭
I can try reuploading the still frame?
maybe that'll fix it?
what I mean is like who has control over it
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
oh
gimme 2 seconndsssss
ok finally fixed it lol
the problem was........you didnt have a handle for ur phone
thats it
omg 😭
I just added a temp one there u can change it when u want
no problem bro keep it u p