I made a script that activates whenever a player joins, I want them to have a block-like character morph.
The code:
Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) --change mesh character.Head:WaitForChild("Mesh").MeshType = Enum.MeshType.Head print(character.Head.Mesh.MeshType) end) end)
The problem is whenever I hit play, the head mesh doesn't change. Also there are no errors presented at this time.
Fairly certain this won't work as it's on the server's side, so you'd need to do this via a remotefunction?
Script:
rs = game:GetService("ReplicatedStorage") Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) character.Head:WaitForChild("Mesh").MeshType = Enum.MeshType.Head print(character.Head.Mesh.MeshType) rs:WaitForChild("RemoteFunction"):InvokeServer() end) end)
Script in ServerScriptStorage:
remoteFunction = Instance.new("RemoteFunction") remoteFunction.Parent = game:GetService("ReplicatedStorage") remoteFunction.OnServerInvoke:Connect(function() --delete head mesh end)
At least this is what I think, otherwise not too sure. Hope you find the fix.