No errors or anything, works to some extent when tested in studio, but in game nothing happens.
---This is the Server script
game.ReplicatedStorage.ValueReturnBus.OnServerInvoke = getPose
game.ReplicatedStorage.PosingTransitor.OnServerEvent:Connect(function(plr, posing, newpose, rScript)
print("firing")
if posing then
newpose:Stop()
plr.Character.Head.Heart.Enabled = false
plr.Character.Humanoid.WalkSpeed = 16
posing = false
plr.PlayerScripts.Poses.PoseOutput.Value = true
print("stopped")
else
posing = true
getPose(posing)
local pose = math.random(1, 1)
if pose == 1 then
newpose = plr.Character.Humanoid:LoadAnimation(rScript.Koichi)
newpose:Play()
plr.Character.Head.Heart.Enabled = true
plr.Character.Humanoid.WalkSpeed = 0
posing = true
plr.PlayerScripts.Poses.PoseOutput.Value = true
print("started")
end
end
end)
function getPose(poz)
return poz
end
--This is the local script
local posing = false
local newpose
local rScript = script
script.Heart.Parent = game.Players.LocalPlayer.Character.Head
if script.PoseOutput.Value == true then
posing = game.ReplicatedStorage.ValueReturnBus:InvokeServer(posing)
script.PoseOutput.Value = false
print(posing)
end
game:GetService("UserInputService").InputBegan:Connect(function(but, gpe)
if but.KeyCode == Enum.KeyCode.P and not gpe then
game.ReplicatedStorage.PosingTransitor:FireServer(posing, newpose, rScript)
end
end)
