Howdy,
Preface
I’ve looked around the Dev Forum for anyone who has had similar issues, but in all the posts I found the solutions were all just making sure the animation and the game were uploaded by the same people which is not the problem here.
The Problem
I’m making a message system very similar to the one found in the Souls games, and I have almost everything working.
My issue however is that the system works for me, and only me. Other users can successfully navigate through the menus to “send” a message, but the animation does not play on their client, only mine. The animation is played using a Local Script located in the player’s character (StarterCharacterScripts).
In this first video, you can see that the other tester plays the animation but doesn’t place down a message, but when I go through the menu to place a message the animation plays and a message gets placed. The other tester is also unable to move after placing a message, but I am.
In the second video (from the tester’s POV) the animation doesn’t play for either their character or my character, but my character still places down a message and can move.
The game is owned and uploaded by me, and the animation is uploaded by me as well. This seems like a reoccurring issue with my animations, as a few animations I’ve made in the same game don’t play for other users but work perfectly fine for me.
The Code
The SendMessage function on the client
local function SendMessage()
character = player.Character
humanoid = character.Humanoid
local go = false
-- If message format is extended, check for other message part so they
-- don't send a half empty message
if bool_Temp1 and bool_Word1 then
if format then
if bool_conj and bool_Temp2 and bool_Word2 then
go = true
end
else
go = true
end
end
if go then
local animator = humanoid:FindFirstChildOfClass("Animator")
local writeAnim = animator:LoadAnimation(anim)
writeGroup.Visible = false
humanoid.WalkSpeed = 0
humanoid.JumpPower = 0
local animEvent
animEvent = writeAnim:GetMarkerReachedSignal("MakeMessage"):Connect(function()
local orient = character.HumanoidRootPart.Orientation
sendEvent:FireServer(txt_FinalMessage, orient)
animEvent:Disconnet() -- Disconnect just in case because I'm paranoid
end)
writeAnim:Play()
writeAnim.Stopped:Wait()
ResetVariables() -- Resets variables to prepare for new message creation
humanoid.WalkSpeed = 16
humanoid.JumpPower = 50
end
end
Code that runs on the server when SendEvent is fired
local function CreateMessage(player, content, orientation)
local position = player.Character.RightHand.Position
local message = script.Message:Clone()
message:SetAttribute("Content", content)
message:SetAttribute("UserId", player.UserId)
message:PivotTo(CFrame.new(position) * CFrame.Angles(0, math.rad(orientation.Y), 0))
message.Parent = workspace.GameMap.Messages
end