So if a player picks a morph, a ScreenGUI pops up and shows various ways to alter your morph. For example, you can make your character smile/frown/etc. This script works only in Studio and I don't know why. And yes, FilteringEnabled is being used. My main goal is to have the changes to the morph be visible to the client and everyone else in the server.

This script is inside the ScreenGUI

-- || Services ||
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

-- || Variables ||
local AnimationRemote = ReplicatedStorage:WaitForChild("AnimationRemote")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local SmileButton = script.Parent.Frame.Smile
local FrownButton = script.Parent.Frame.Frown

-- || EventTriggerer ||
SmileButton.MouseButton1Click:connect(function()
AnimationRemote:FireServer("Smile")
end)

FrownButton.MouseButton1Click:connect(function()
AnimationRemote:FireServer("Frown")
end)

And this script is in ServerScriptService

-- || Services ||
local ReplicatedStorage = game:GetService("ReplicatedStorage")

-- || Variables ||
local AnimationRemote = Instance.new("RemoteEvent", ReplicatedStorage) AnimationRemote.Name = "AnimationRemote"

-- || EventHandler ||
AnimationRemote.OnServerEvent:connect(function(Ply, Animation)
if Animation == "Smile" then
Ply.Character.Chest:FindFirstChild("HeadSmile").Transparency = 0 -- this is a part in the morph
Ply.Character.Chest:FindFirstChild("HeadFrown").Transparency = 1
elseif Animation == "Frown" then
Ply.Character.Chest:FindFirstChild("HeadSmile").Transparency = 1
Ply.Character.Chest:FindFirstChild("HeadFrown").Transparency = 0
end
end)

I'm new to RemoteEvents so I'm unsure of what I'm doing.

2 comments

0

Have you tried adding the remote event to the workspace manually in the explorer instead of through a script?

0

No. Truthfully, I'm not sure how to do that.